diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/gem_path_searcher.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb index eca80cc985..e4360c616e 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -476,9 +476,9 @@ module Gem load_path_files = suffixes.map do |sfx| base = path + sfx $LOAD_PATH.map {|load_path| - File.expand_path(base, load_path) - }.select {|f| File.file?(f.untaint)} - end.flatten + Dir[File.expand_path(base, load_path)] + } + end.flatten.select {|f| File.file?(f.untaint)} specs = searcher.find_all path diff --git a/lib/rubygems/gem_path_searcher.rb b/lib/rubygems/gem_path_searcher.rb index a745b0291c..6ee3c078d5 100644 --- a/lib/rubygems/gem_path_searcher.rb +++ b/lib/rubygems/gem_path_searcher.rb @@ -69,8 +69,8 @@ class Gem::GemPathSearcher def matching_files(spec, path) return [] unless @lib_dirs[spec.object_id] # case no paths - load_path = File.join(@lib_dirs[spec.object_id], path) - Gem.suffixes.map {|sfx| load_path + sfx}.select {|f| File.file?(f.untaint)} + glob = File.join @lib_dirs[spec.object_id], "#{path}#{Gem.suffix_pattern}" + Dir[glob].select { |f| File.file? f.untaint } end ## |