From 1c8c901e3c553bdd15d2a1e5e9d8ce4c5c6c7aa2 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 8 Aug 2010 07:42:51 +0000 Subject: [PATCH] * lib/rubygems.rb (Gem.find_files): reverted to use globbing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++---- lib/rubygems.rb | 6 +++--- lib/rubygems/gem_path_searcher.rb | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8667ecdc54..90529df8fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,10 @@ -Sun Aug 8 16:22:04 2010 Nobuyoshi Nakada +Sun Aug 8 16:42:48 2010 Nobuyoshi Nakada + + * lib/rubygems.rb (Gem.find_files): reverted to use globbing. * 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. - * gem_prelude.rb, lib/rubygems.rb (Gem.suffixes): return truely require-able suffixes only. 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 ##