1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gem_prelude.rb (Gem::QuickLoader.load_full_rubygems_library):

get rid of creating same regexps many times.

* lib/rubygems/custom_require.rb (Kernel#require): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-23 05:37:26 +00:00
parent 9e67f6ecec
commit 80db78f51c
3 changed files with 11 additions and 8 deletions

View file

@ -30,7 +30,7 @@ module Kernel
def require(path) # :doc:
gem_original_require path
rescue LoadError => load_error
if load_error.message =~ /#{Regexp.escape path}\z/ and
if load_error.message.end_with?(path) and
spec = Gem.searcher.find(path) then
Gem.activate(spec.name, "= #{spec.version}")
gem_original_require path