summaryrefslogtreecommitdiff
path: root/lib/rubygems/dependency_list.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-01 03:45:05 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-01 03:45:05 +0000
commitd22130922e7842226d38d59680e4bbb48a28a5f0 (patch)
tree39594d3a14641dd5488a99a5e633239296fa5742 /lib/rubygems/dependency_list.rb
parent4752539e3f3e563d559732c52424206bd6f12dbd (diff)
Import rubygems 1.8.5 (released @ 137c80f)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency_list.rb')
-rw-r--r--lib/rubygems/dependency_list.rb29
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