From 9f6fecbeca4ed3baead52c1ae990a11f155803f4 Mon Sep 17 00:00:00 2001 From: yugui Date: Wed, 15 Jul 2009 09:05:32 +0000 Subject: * ext/purelib.rb: translates a fake path to rubygems in $" into an alternative in $: so that Kernel.#require does not load more rubygems.rb. Resolves many failures in test/rubygems/*. * gem_prelude.rb (Gem.load_full_rubygems_library): supports case the rubygems to load is not in $(rubylibprefix). (Gem.path_to_full_rubygems_library): new method for the changes in purelib.rb and Gem.load_full_rubygems_library. (Gem.fake_rubygems_as_loaded): new method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/purelib.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/purelib.rb b/ext/purelib.rb index dbe514c34..6418fd618 100644 --- a/ext/purelib.rb +++ b/ext/purelib.rb @@ -6,5 +6,12 @@ $:.each_with_index {|path, index| end } if nul - $:[nul..-1] = ["."] + removed, $:[nul..-1] = $:[nul..-1], ["."] + if defined?(Gem::QuickLoader) + removed.each do |path| + # replaces a fake rubygems by gem_prelude.rb with an alternative path + index = $".index(File.join(path, 'rubygems.rb')) + $"[index] = Gem::QuickLoader.path_to_full_rubygems_library if index + end + end end -- cgit