diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-02 05:15:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-02 05:15:53 +0000 |
commit | a499d1e69865ec17fee0e9bcaf493ac1d4d559ae (patch) | |
tree | 687ccabd522053bcc546b61d62a565b2a7df2bcd | |
parent | aae22e34086553d30d071e2575c240f6f89550d3 (diff) |
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
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib/rubygems.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/test_case.rb | 4 |
3 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,11 @@ +Thu Jul 2 14:15:50 2015 Nobuyoshi Nakada <[email protected]> + + * 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. + Thu Jul 2 14:12:01 2015 Nobuyoshi Nakada <[email protected]> * ruby.c (process_options): also copy initial load path marks at 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 diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index aee4b75773..9edb6b48bd 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -269,7 +269,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase Gem.ensure_gem_subdirectories @gemhome @orig_LOAD_PATH = $LOAD_PATH.dup - $LOAD_PATH.map! { |s| File.expand_path(s).untaint } + $LOAD_PATH.map! { |s| + (expand_path = File.expand_path(s)) == s ? s : expand_path.untaint + } Dir.chdir @tempdir |