summaryrefslogtreecommitdiff
path: root/lib/rubygems/dependency_list.rb
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/dependency_list.rb38
1 files changed, 35 insertions, 3 deletions
@@ -17,6 +17,7 @@ require 'tsort'
# correct order to avoid conflicts.
class Gem::DependencyList
include Enumerable
include TSort
@@ -56,6 +57,10 @@ class Gem::DependencyList
@specs.push(*gemspecs)
end
##
# Return a list of the gem specifications in the dependency list, sorted in
# order so that no gemspec in the list depends on a gemspec earlier in the
@@ -110,11 +115,26 @@ class Gem::DependencyList
# Are all the dependencies in the list satisfied?
def ok?
- @specs.all? do |spec|
- spec.runtime_dependencies.all? do |dep|
- @specs.find { |s| s.satisfies_requirement? dep }
end
end
end
##
@@ -147,6 +167,18 @@ class Gem::DependencyList
end
##
# Removes the gemspec matching +full_name+ from the dependency list
def remove_by_name(full_name)