diff options
Diffstat (limited to 'lib/rubygems/dependency_list.rb')
-rw-r--r-- | lib/rubygems/dependency_list.rb | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb index a3db1d6829..232f83c68c 100644 --- a/lib/rubygems/dependency_list.rb +++ b/lib/rubygems/dependency_list.rb @@ -11,6 +11,7 @@ #++ require 'tsort' +require 'rubygems/deprecate' ## # Gem::DependencyList is used for installing and uninstalling gems in the @@ -28,16 +29,21 @@ class Gem::DependencyList attr_accessor :development ## - # Creates a DependencyList from a Gem::SourceIndex +source_index+ + # Creates a DependencyList from the current specs. - def self.from_source_index(source_index) + def self.from_specs list = new + list.add(*Gem::Specification.map) + list + end - source_index.each do |full_name, spec| - list.add spec - end + ## + # Creates a DependencyList from a Gem::SourceIndex +source_index+ - list + def self.from_source_index(ignored=nil) + warn "NOTE: DependencyList.from_source_index ignores it's arg" if ignored + + from_specs end ## @@ -120,10 +126,9 @@ class Gem::DependencyList def why_not_ok? quick = false unsatisfied = Hash.new { |h,k| h[k] = [] } - source_index = Gem.source_index each do |spec| spec.runtime_dependencies.each do |dep| - inst = source_index.any? { |_, installed_spec| + inst = Gem::Specification.any? { |installed_spec| dep.name == installed_spec.name and dep.requirement.satisfied_by? installed_spec.version } @@ -134,6 +139,7 @@ class Gem::DependencyList end end end + unsatisfied end @@ -242,6 +248,11 @@ class Gem::DependencyList def active_count(specs, ignored) specs.count { |spec| ignored[spec.full_name].nil? } end - end +class Gem::DependencyList + class << self + extend Deprecate + deprecate :from_source_index, "from_specs", 2011, 11 + end +end |