[前][次][番号順一覧][スレッド一覧]

ruby-changes:39023

From: nobu <ko1@a...>
Date: Thu, 2 Jul 2015 14:16:13 +0900 (JST)
Subject: [ruby-changes:39023] nobu:r51104 (trunk): rubygems.rb: use @gem_prelude_index

nobu	2015-07-02 14:15:53 +0900 (Thu, 02 Jul 2015)

  New Revision: 51104

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51104

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/test_case.rb
    trunk/lib/rubygems.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51103)
+++ ChangeLog	(revision 51104)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul  2 14:15:50 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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  <nobu@r...>
 
 	* ruby.c (process_options): also copy initial load path marks at
Index: lib/rubygems/test_case.rb
===================================================================
--- lib/rubygems/test_case.rb	(revision 51103)
+++ lib/rubygems/test_case.rb	(revision 51104)
@@ -269,7 +269,9 @@ class Gem::TestCase < MiniTest::Unit::Te https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L269
     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
 
Index: lib/rubygems.rb
===================================================================
--- lib/rubygems.rb	(revision 51103)
+++ lib/rubygems.rb	(revision 51104)
@@ -577,6 +577,10 @@ module Gem https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L577
   # 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]