From e45d17b9d24d3d70eb974f52a6e981b212f47f6c Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 8 Aug 2010 07:22:07 +0000 Subject: * lib/rubygems.rb (Gem.find_files): fixed search order same as default behavior. * lib/rubygems/gem_path_searcher.rb (matching_files): check if exist, not globbing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/rubygems.rb') diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 552c6f6b57..25da9d9cf8 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -473,12 +473,11 @@ module Gem # versions of the same gem. def self.find_files(path) - load_path_files = $LOAD_PATH.map do |load_path| - files = Dir["#{File.expand_path path, load_path}#{Gem.suffix_pattern}"] - - files.select do |load_path_file| - File.file? load_path_file.untaint - end + suffixes.map do |sfx| + base = path + sfx + load_path_files = $LOAD_PATH.map {|load_path| + File.expand_path(base, load_path) + }.select {|f| File.file?(f.untaint)} end.flatten specs = searcher.find_all path -- cgit v1.2.3