summaryrefslogtreecommitdiff
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
commit618cb2cab05ea0629c91dc5a5351fe3cfd6d0863 (patch)
treec3e74fd24a04258b6f39216a7b4d64373cf4dfcf /ext
parentdc1327a6f2c779775e147fc3f020b0af114c4c19 (diff)
* 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: svn+ssh://ci.ruby-lang.org/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 dbe514c34a..6418fd618d 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