mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use Tempfile.create to unlink the tempfile on Windows
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6d45dd20df
commit
7bc77b76fe
1 changed files with 3 additions and 0 deletions
|
@ -15,7 +15,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||
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::Ext::Builder
|
|||
ENV["DESTDIR"] = destdir
|
||||
end
|
||||
end
|
||||
t.unlink if t
|
||||
ensure
|
||||
FileUtils.rm_rf tmp_dest if tmp_dest
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue