aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/dependency_list.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-14 12:59:03 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-14 12:59:03 +0000
commit4ae3df42f723d25b0fe4ba6b2689d607b01c6f48 (patch)
tree26c5f5cf033f79373e63b10f684df07898b7cd8f /lib/rubygems/dependency_list.rb
parentd1e6304a891fc5e9cc63e50520bdc798fb95b829 (diff)
downloadruby-4ae3df42f723d25b0fe4ba6b2689d607b01c6f48.tar.gz
Merge RubyGems master@9be7858f7f17eae3058204f3c03e4b798ba18b9c
This version contains the some style changes by RuboCop. * https://github.com/rubygems/rubygems/commit/9d810be0ede925fb2e3af535848582c3f8e0e72f * https://github.com/rubygems/rubygems/commit/61ea98a727fb1b76b6fac52d74107ee4b02aaef2 * https://github.com/rubygems/rubygems/commit/795893dce3c5f8540804fc08144cc6a90f086b13 * https://github.com/rubygems/rubygems/commit/9be7858f7f17eae3058204f3c03e4b798ba18b9c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency_list.rb')
-rw-r--r--lib/rubygems/dependency_list.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb
index ee2e4c7343..eec2223077 100644
--- a/lib/rubygems/dependency_list.rb
+++ b/lib/rubygems/dependency_list.rb
@@ -17,6 +17,7 @@ require 'rubygems/deprecate'
# this class necessary anymore? Especially #ok?, #why_not_ok?
class Gem::DependencyList
+
attr_reader :specs
include Enumerable
@@ -118,10 +119,10 @@ class Gem::DependencyList
unsatisfied = Hash.new { |h,k| h[k] = [] }
each do |spec|
spec.runtime_dependencies.each do |dep|
- inst = Gem::Specification.any? { |installed_spec|
+ inst = Gem::Specification.any? do |installed_spec|
dep.name == installed_spec.name and
dep.requirement.satisfied_by? installed_spec.version
- }
+ end
unless inst or @specs.find { |s| s.satisfies_requirement? dep }
unsatisfied[spec.name] << dep
@@ -145,10 +146,10 @@ class Gem::DependencyList
# If the state is inconsistent, at least don't crash
return true unless gem_to_remove
- siblings = @specs.find_all { |s|
+ siblings = @specs.find_all do |s|
s.name == gem_to_remove.name &&
s.full_name != gem_to_remove.full_name
- }
+ end
deps = []
@@ -160,11 +161,11 @@ class Gem::DependencyList
end
end
- deps.all? { |dep|
- siblings.any? { |s|
+ deps.all? do |dep|
+ siblings.any? do |s|
s.satisfies_requirement? dep
- }
- }
+ end
+ end
end
##
@@ -173,10 +174,10 @@ class Gem::DependencyList
# dependencies).
def remove_specs_unsatisfied_by(dependencies)
- specs.reject! { |spec|
+ specs.reject! do |spec|
dep = dependencies[spec.name]
dep and not dep.requirement.satisfied_by? spec.version
- }
+ end
end
##