diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-28 02:26:39 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-28 02:26:39 +0000 |
commit | b177a87a1c48e3d763f94ab327a6532d51eb9a51 (patch) | |
tree | bd57731d31e70e0b5837bcff618f0b56b2be3b5e /lib/rubygems/dependency.rb | |
parent | 276e899fd5993c0723b85cee2b9452b3b22ac096 (diff) | |
download | ruby-b177a87a1c48e3d763f94ab327a6532d51eb9a51.tar.gz |
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.2.
Please see entries of 2.6.2 on
https://github.com/rubygems/rubygems/blob/master/History.txt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency.rb')
-rw-r--r-- | lib/rubygems/dependency.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index bf24b6e724..b7aea4692b 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -286,7 +286,9 @@ class Gem::Dependency } end - matches.sort_by { |s| s.sort_obj } # HACK: shouldn't be needed + # `stubs_for` returns oldest first, but `matching_specs` is supposed to + # return newest first, so just reverse the list + matches.reverse end ## @@ -302,14 +304,13 @@ class Gem::Dependency # TODO: check Gem.activated_spec[self.name] in case matches falls outside if matches.empty? then - specs = Gem::Specification.find_all { |s| - s.name == name - }.map { |x| x.full_name } + specs = Gem::Specification.stubs_for name if specs.empty? - total = Gem::Specification.to_a.size + total = Gem::Specification.stubs.size msg = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n".dup else + specs = specs.map(&:full_name) msg = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n".dup end msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information" @@ -334,6 +335,6 @@ class Gem::Dependency matches.delete_if { |spec| spec.nil? || spec.version.prerelease? } unless prerelease? - matches.last + matches.first end end |