Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Tempfile.create to unlink siteconf on Windows

Import of r41893 from ruby trunk by naruse
  • Loading branch information...
commit 8e46fc3ebee97976c430978c0a46a73f4c1857d7 1 parent 472ccf3
@drbrain drbrain authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/rubygems/ext/ext_conf_builder.rb
View
3  lib/rubygems/ext/ext_conf_builder.rb
@@ -15,7 +15,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
def self.build(extension, directory, dest_path, results)
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|
@@ -53,6 +55,7 @@ def self.build(extension, directory, dest_path, results)
ENV["DESTDIR"] = destdir
end
end
+ t.unlink if t
ensure
FileUtils.rm_rf tmp_dest if tmp_dest
end
Please sign in to comment.
Something went wrong with that request. Please try again.