summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-15 09:05:32 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-15 09:05:32 +0000
commit9f6fecbeca4ed3baead52c1ae990a11f155803f4 (patch)
treec3e74fd24a04258b6f39216a7b4d64373cf4dfcf /ext
parent33ba2be3de311b24775cc33ff6629999fe983ec5 (diff)
downloadruby-9f6fecbeca4ed3baead52c1ae990a11f155803f4.tar.gz
ruby-9f6fecbeca4ed3baead52c1ae990a11f155803f4.tar.xz
ruby-9f6fecbeca4ed3baead52c1ae990a11f155803f4.zip
* 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
Diffstat (limited to 'ext')
-rw-r--r--ext/purelib.rb9
1 files changed, 8 insertions, 1 deletions
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