merge revision(s) 28245:

------------------------------------------------------------------------
r28245 | naruse | 2010-06-10 13:31:08 +0900 (Thu, 10 Jun 2010) | 4 lines

Revert r28200.

It caused many failures on test-all and following is SEGV.
./ruby -e 'require %!#{"foo/" * 10000}foo!'
------------------------------------------------------------------------


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-06-10 05:04:20 +00:00
parent 05f0e2aed7
commit 3c6fac490d
9 changed files with 113 additions and 144 deletions

View file

@ -4,6 +4,8 @@
# See LICENSE.txt for permissions.
#++
require 'rubygems'
module Kernel
##
@ -29,17 +31,10 @@ module Kernel
gem_original_require path
rescue LoadError => load_error
if load_error.message.end_with?(path) and
begin
Gem.try_activate(path)
rescue Gem::LoadError => load_error
pat = "#{__FILE__}:#{__LINE__-2}:in "
bt = load_error.backtrace
num = bt.index {|e| e.start_with?(pat)} and bt.shift(num+2)
raise load_error
end
retry
spec = Gem.searcher.find(path) then
Gem.activate(spec.name, "= #{spec.version}")
gem_original_require path
else
load_error.backtrace.shift(2)
raise load_error
end
end
@ -47,5 +42,5 @@ module Kernel
private :require
private :gem_original_require
end unless Kernel.private_method_defined?(:gem_original_require)
end