Skip to content

Commit

Permalink
ensure tempfile is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed May 26, 2011
1 parent f9736a4 commit 1f4f79b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/closure/compiler.rb
Expand Up @@ -29,12 +29,14 @@ def compile(io)
else
tempfile.write(io.to_s)
end
tempfile.close
tempfile.flush

begin
result = `#{command} --js #{tempfile.path}`
rescue Exception
raise Error, "compression failed"
ensure
tempfile.close!
end
unless $?.exitstatus.zero?
raise Error, result
Expand Down

0 comments on commit 1f4f79b

Please sign in to comment.