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

ruby-changes:27507

From: nobu <ko1@a...>
Date: Sun, 3 Mar 2013 01:16:28 +0900 (JST)
Subject: [ruby-changes:27507] nobu:r39559 (trunk): ext_conf_builder.rb: use RUBYOPT

nobu	2013-03-03 01:16:19 +0900 (Sun, 03 Mar 2013)

  New Revision: 39559

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

  Log:
    ext_conf_builder.rb: use RUBYOPT
    
    * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
      use RUBYOPT instead of -r option, and revert some tests.  [Bug #7698]

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/ext/ext_conf_builder.rb
    trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb
    trunk/test/rubygems/test_gem_installer.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39558)
+++ ChangeLog	(revision 39559)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Sun Mar  3 01:14:28 2013  Nobuyoshi Nakada  <nobu@r...>
+Sun Mar  3 01:16:16 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+	  use RUBYOPT instead of -r option, and revert some tests.  [Bug #7698]
 
 	* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
 	  revert use of temporary directory for build, to work some buggy
Index: lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- lib/rubygems/ext/ext_conf_builder.rb	(revision 39558)
+++ lib/rubygems/ext/ext_conf_builder.rb	(revision 39559)
@@ -22,7 +22,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/ext_conf_builder.rb#L22
       f
     end
 
-    cmd = [Gem.ruby, "-r#{siteconf.path}", File.basename(extension), *args].join ' '
+    rubyopt = ENV["RUBYOPT"]
+    ENV["RUBYOPT"] = ["-r#{siteconf.path}", rubyopt].compact.join(' ')
+    cmd = [Gem.ruby, File.basename(extension), *args].join ' '
 
     run cmd, results
 
@@ -30,6 +32,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/ext_conf_builder.rb#L32
 
     results
   ensure
+    ENV["RUBYOPT"] = rubyopt
     siteconf.close(true) if siteconf
   end
 
Index: test/rubygems/test_gem_ext_ext_conf_builder.rb
===================================================================
--- test/rubygems/test_gem_ext_ext_conf_builder.rb	(revision 39558)
+++ test/rubygems/test_gem_ext_ext_conf_builder.rb	(revision 39559)
@@ -30,7 +30,7 @@ class TestGemExtExtConfBuilder < Gem::Te https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L30
       Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
     end
 
-    assert_match(/^#{Gem.ruby} .*extconf.rb/, output[0])
+    assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
     assert_equal "creating Makefile\n", output[1]
     case RUBY_PLATFORM
     when /mswin/ then
@@ -107,10 +107,10 @@ class TestGemExtExtConfBuilder < Gem::Te https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L107
 
     assert_match(/\Aextconf failed:
 
-#{Gem.ruby} .*extconf.rb.*
+#{Gem.ruby} extconf.rb.*
 checking for main\(\) in .*?nonexistent/m, error.message)
 
-    assert_match(/^#{Gem.ruby} .*extconf.rb/, output[0])
+    assert_equal("#{Gem.ruby} extconf.rb", output[0])
   end
 
   def test_class_make
Index: test/rubygems/test_gem_installer.rb
===================================================================
--- test/rubygems/test_gem_installer.rb	(revision 39558)
+++ test/rubygems/test_gem_installer.rb	(revision 39559)
@@ -81,7 +81,7 @@ load Gem.bin_path('a', 'executable', ver https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L81
 
     gem_make_out = File.join @gemhome, 'gems', @spec.full_name, 'gem_make.out'
 
-    assert_match %r%#{Regexp.escape Gem.ruby} .*extconf\.rb%,
+    assert_match %r%#{Regexp.escape Gem.ruby} extconf\.rb%,
                  File.read(gem_make_out)
     assert_match %r%#{Regexp.escape Gem.ruby}: No such file%,
                  File.read(gem_make_out)

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

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