diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-21 10:20:47 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-21 10:20:47 +0000 |
commit | 5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch) | |
tree | c63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/dependency_list.rb | |
parent | 2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff) | |
download | ruby-5335ce0e060c7a2a0b01c57f8f8a64254f2658e1.tar.gz |
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop
https://github.com/rubygems/rubygems/pull/2478
* Enable Style/MultilineIfThen in Rubocop
https://github.com/rubygems/rubygems/pull/2479
* Fix required_ruby_version with prereleases and improve error message
https://github.com/rubygems/rubygems/pull/2344
* Fix bundler rubygems binstub not properly looking for bundler
https://github.com/rubygems/rubygems/pull/2426
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency_list.rb')
-rw-r--r-- | lib/rubygems/dependency_list.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb index d8314eaf60..ee2e4c7343 100644 --- a/lib/rubygems/dependency_list.rb +++ b/lib/rubygems/dependency_list.rb @@ -40,7 +40,7 @@ class Gem::DependencyList # Creates a new DependencyList. If +development+ is true, development # dependencies will be included. - def initialize development = false + def initialize(development = false) @specs = [] @development = development @@ -79,8 +79,8 @@ class Gem::DependencyList seen = {} sorted.each do |spec| - if index = seen[spec.name] then - if result[index].version < spec.version then + if index = seen[spec.name] + if result[index].version < spec.version result[index] = spec end else @@ -114,7 +114,7 @@ class Gem::DependencyList why_not_ok?(:quick).empty? end - def why_not_ok? quick = false + def why_not_ok?(quick = false) unsatisfied = Hash.new { |h,k| h[k] = [] } each do |spec| spec.runtime_dependencies.each do |dep| @@ -123,7 +123,7 @@ class Gem::DependencyList dep.requirement.satisfied_by? installed_spec.version } - unless inst or @specs.find { |s| s.satisfies_requirement? dep } then + unless inst or @specs.find { |s| s.satisfies_requirement? dep } unsatisfied[spec.name] << dep return unsatisfied if quick end @@ -172,7 +172,7 @@ class Gem::DependencyList # satisfy items in +dependencies+ (a hash of gem names to arrays of # dependencies). - def remove_specs_unsatisfied_by dependencies + def remove_specs_unsatisfied_by(dependencies) specs.reject! { |spec| dep = dependencies[spec.name] dep and not dep.requirement.satisfied_by? spec.version @@ -200,7 +200,7 @@ class Gem::DependencyList next if spec == other other.dependencies.each do |dep| - if spec.satisfies_requirement? dep then + if spec.satisfies_requirement? dep result[spec] << other end end @@ -222,7 +222,7 @@ class Gem::DependencyList dependencies.each do |dep| specs.each do |spec| - if spec.satisfies_requirement? dep then + if spec.satisfies_requirement? dep yield spec break end @@ -241,4 +241,3 @@ class Gem::DependencyList end end - |