diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
commit | 31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch) | |
tree | 10e44506238c7af3d7c9d822111996731726e38d /lib/rubygems/gem_path_searcher.rb | |
parent | a6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff) |
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/gem_path_searcher.rb')
-rw-r--r-- | lib/rubygems/gem_path_searcher.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/rubygems/gem_path_searcher.rb b/lib/rubygems/gem_path_searcher.rb index e2b8543bb0..2232a574e3 100644 --- a/lib/rubygems/gem_path_searcher.rb +++ b/lib/rubygems/gem_path_searcher.rb @@ -4,8 +4,6 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems' - ## # GemPathSearcher has the capability to find loadable files inside # gems. It generates data up front to speed up searches later. @@ -80,11 +78,15 @@ class Gem::GemPathSearcher ## # Return a list of all installed gemspecs, sorted by alphabetical order and - # in reverse version order. + # in reverse version order. (bar-2, bar-1, foo-2) def init_gemspecs - Gem.source_index.map { |_, spec| spec }.sort { |a,b| - (a.name <=> b.name).nonzero? || (b.version <=> a.version) + specs = Gem.source_index.map { |_, spec| spec } + + specs.sort { |a, b| + names = a.name <=> b.name + next names if names.nonzero? + b.version <=> a.version } end |