summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-07 15:40:52 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-07 15:40:52 +0000
commitd1de97e0bcdb0f9b79cc3dbce843c4a8ac705443 (patch)
treea644169f4c19263702522f8c0ff2303d8014efe2 /lib/rubygems.rb
parentce9c95293757a211bf9dcdb45908a835e5080f7d (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/trunk@28570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb20
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