Pull initialization code out of begin block
This commit is contained in:
parent
b34fa6cfd8
commit
0578f1ff5a
@ -106,6 +106,7 @@ class Pathname
|
|||||||
def atomic_write content
|
def atomic_write content
|
||||||
require "tempfile"
|
require "tempfile"
|
||||||
tf = Tempfile.new(basename.to_s, dirname)
|
tf = Tempfile.new(basename.to_s, dirname)
|
||||||
|
begin
|
||||||
tf.binmode
|
tf.binmode
|
||||||
tf.write(content)
|
tf.write(content)
|
||||||
|
|
||||||
@ -128,6 +129,7 @@ class Pathname
|
|||||||
ensure
|
ensure
|
||||||
tf.close!
|
tf.close!
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def default_stat
|
def default_stat
|
||||||
sentinel = parent.join(".brew.#{Process.pid}.#{rand(Time.now.to_i)}")
|
sentinel = parent.join(".brew.#{Process.pid}.#{rand(Time.now.to_i)}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user