diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-13 15:53:05 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-13 15:53:05 +0000 |
commit | 76b30ac28f4530d02c9867da0b22da370a20668d (patch) | |
tree | 3d4f1593ba4ef85745e828ef245acdfca9d2eff8 /lib | |
parent | 40507a4946be37cc77b6c5abea9822f6c24a0df9 (diff) |
* gem_prelude.rb: provide workaround for gem activation. Currently,
gem activation does not work by default. Now it can be worked
around by requiring "rubygems" first. [ruby-core:29486]
a patch from Evan Phoenix in [ruby-core:31096].
* lib/rubygems.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb index d2e0f2cb5d..51661159cc 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -7,6 +7,11 @@ gem_disabled = !defined? Gem +unless gem_disabled + # Nuke the Quickloader stuff + Gem::QuickLoader.remove +end + require 'rubygems/defaults' require 'thread' require 'etc' @@ -579,6 +584,12 @@ module Gem $LOAD_PATH.index { |p| p.instance_variable_defined? :@gem_prelude_index } end + def self.remove_prelude_paths + Gem::QuickLoader::GemLoadPaths.each do |path| + $LOAD_PATH.delete(path) + end + end + ## # The file name and line number of the caller of the caller of this method. @@ -1098,13 +1109,14 @@ end require 'rubygems/config_file' +Gem.remove_prelude_paths + ## # Enables the require hook for RubyGems. # -# Ruby 1.9 allows --disable-gems, so we require it when we didn't detect a Gem -# constant at rubygems.rb load time. - -require 'rubygems/custom_require' if gem_disabled or RUBY_VERSION < '1.9' +# We remove the paths prelude added, so we need custom require to get +# any gems now. +require 'rubygems/custom_require' Gem.clear_paths |