mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* 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
This commit is contained in:
parent
8481c848da
commit
669d43780e
3 changed files with 16 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue