aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-02 05:15:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-02 05:15:53 +0000
commita499d1e69865ec17fee0e9bcaf493ac1d4d559ae (patch)
tree687ccabd522053bcc546b61d62a565b2a7df2bcd /lib/rubygems.rb
parentaae22e34086553d30d071e2575c240f6f89550d3 (diff)
downloadruby-a499d1e69865ec17fee0e9bcaf493ac1d4d559ae.tar.gz
rubygems.rb: use @gem_prelude_index
* lib/rubygems.rb (Gem.load_path_insert_index): search @gem_prelude_index first. * lib/rubygems/test_case.rb (Gem::TestCase#setup): keep already expanded paths to prserve instance variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 7af0694402..dd01fa3838 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -577,6 +577,10 @@ module Gem
# gem's paths are inserted before site lib directory by default.
def self.load_path_insert_index
+ $LOAD_PATH.each_with_index do |path, i|
+ return i if path.instance_variable_defined?(:@gem_prelude_index)
+ end
+
index = $LOAD_PATH.index RbConfig::CONFIG['sitelibdir']
index