summaryrefslogtreecommitdiff
path: root/gem_prelude.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-12 01:51:47 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-12 01:51:47 (GMT)
commit669d43780e16fd861b64dbf90d817fdeffa761fd (patch)
treea0fce6a1bfb4ce380de4baa9821fc61520df2725 /gem_prelude.rb
parent8481c848da553c3f2822e9f24407f3a23118d129 (diff)
* gem_prelude.rb (load_full_rubygems_library, const_missing): prevent
infinite recursion. [ruby-dev:34539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gem_prelude.rb')
-rw-r--r--gem_prelude.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index e727bee..8be9051 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -86,7 +86,9 @@ if defined?(Gem::Enable) && Gem::Enable then
end
end
- Kernel.send :undef_method, :gem
+ Kernel.module_eval do
+ undef_method :gem if method_defined? :gem
+ end
$".delete File.join(Gem::ConfigMap[:libdir], 'ruby',
Gem::ConfigMap[:ruby_version], 'rubygems.rb')
@@ -186,7 +188,11 @@ if defined?(Gem::Enable) && Gem::Enable then
def const_missing(constant)
QuickLoader.load_full_rubygems_library
- Gem.const_get(constant)
+ if Gem.const_defined?(constant)
+ Gem.const_get(constant)
+ else
+ super
+ end
end
def method_missing(method, *args, &block)