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

ruby-changes:29841

From: naruse <ko1@a...>
Date: Wed, 10 Jul 2013 17:27:50 +0900 (JST)
Subject: [ruby-changes:29841] naruse:r41893 (trunk): Use Tempfile.create to unlink the tempfile on Windows

naruse	2013-07-10 17:27:34 +0900 (Wed, 10 Jul 2013)

  New Revision: 41893

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

  Log:
    Use Tempfile.create to unlink the tempfile on Windows

  Modified files:
    trunk/lib/rubygems/ext/ext_conf_builder.rb

Index: lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- lib/rubygems/ext/ext_conf_builder.rb	(revision 41892)
+++ lib/rubygems/ext/ext_conf_builder.rb	(revision 41893)
@@ -15,7 +15,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/ext_conf_builder.rb#L15
   def self.build(extension, directory, dest_path, results, args=[])
     tmp_dest = Dir.mktmpdir(".gem.", ".")
 
+    t = nil
     Tempfile.open %w"siteconf .rb", "." do |siteconf|
+      t = siteconf
       siteconf.puts "require 'rbconfig'"
       siteconf.puts "dest_path = #{(tmp_dest || dest_path).dump}"
       %w[sitearchdir sitelibdir].each do |dir|
@@ -54,6 +56,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/ext_conf_builder.rb#L56
         ENV["DESTDIR"] = destdir
       end
     end
+    t.unlink if t
   ensure
     FileUtils.rm_rf tmp_dest if tmp_dest
   end

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

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