* 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:
parent
9e67f6ecec
commit
80db78f51c
@ -1,3 +1,10 @@
|
|||||||
|
Fri Apr 23 14:37:22 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Fri Apr 23 14:07:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Apr 23 14:07:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* doc/etc.rd, doc/etc.rd.ja: moved from ext/etc.
|
* doc/etc.rd, doc/etc.rd.ja: moved from ext/etc.
|
||||||
|
@ -142,9 +142,7 @@ if defined?(Gem) then
|
|||||||
@loaded_full_rubygems_library = true
|
@loaded_full_rubygems_library = true
|
||||||
|
|
||||||
class << Gem
|
class << Gem
|
||||||
Gem::GEM_PRELUDE_METHODS.each do |method_name|
|
undef_method *Gem::GEM_PRELUDE_METHODS
|
||||||
undef_method method_name
|
|
||||||
end
|
|
||||||
undef_method :const_missing
|
undef_method :const_missing
|
||||||
undef_method :method_missing
|
undef_method :method_missing
|
||||||
end
|
end
|
||||||
@ -154,11 +152,9 @@ if defined?(Gem) then
|
|||||||
end
|
end
|
||||||
|
|
||||||
$".delete path_to_full_rubygems_library
|
$".delete path_to_full_rubygems_library
|
||||||
$".each do |path|
|
if $".any? {|path| path.end_with?('/rubygems.rb')}
|
||||||
if /#{Regexp.escape File::SEPARATOR}rubygems\.rb\z/ =~ path
|
|
||||||
raise LoadError, "another rubygems is already loaded from #{path}"
|
raise LoadError, "another rubygems is already loaded from #{path}"
|
||||||
end
|
end
|
||||||
end
|
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ module Kernel
|
|||||||
def require(path) # :doc:
|
def require(path) # :doc:
|
||||||
gem_original_require path
|
gem_original_require path
|
||||||
rescue LoadError => load_error
|
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
|
spec = Gem.searcher.find(path) then
|
||||||
Gem.activate(spec.name, "= #{spec.version}")
|
Gem.activate(spec.name, "= #{spec.version}")
|
||||||
gem_original_require path
|
gem_original_require path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user