ruby-changes:16926
From: nobu <ko1@a...>
Date: Sun, 8 Aug 2010 16:43:03 +0900 (JST)
Subject: [ruby-changes:16926] Ruby:r28922 (trunk): * lib/rubygems.rb (Gem.find_files): reverted to use globbing.
nobu 2010-08-08 16:42:51 +0900 (Sun, 08 Aug 2010) New Revision: 28922 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28922 Log: * lib/rubygems.rb (Gem.find_files): reverted to use globbing. Modified files: trunk/ChangeLog trunk/lib/rubygems/gem_path_searcher.rb trunk/lib/rubygems.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 28921) +++ ChangeLog (revision 28922) @@ -1,11 +1,10 @@ -Sun Aug 8 16:22:04 2010 Nobuyoshi Nakada <nobu@r...> +Sun Aug 8 16:42:48 2010 Nobuyoshi Nakada <nobu@r...> + * 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. Index: lib/rubygems/gem_path_searcher.rb =================================================================== --- lib/rubygems/gem_path_searcher.rb (revision 28921) +++ lib/rubygems/gem_path_searcher.rb (revision 28922) @@ -69,8 +69,8 @@ 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 ## Index: lib/rubygems.rb =================================================================== --- lib/rubygems.rb (revision 28921) +++ lib/rubygems.rb (revision 28922) @@ -476,9 +476,9 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/