summaryrefslogtreecommitdiff
path: root/rubyfy.rb
diff options
context:
space:
mode:
authorPaul Buetow (uranus) <paul@buetow.org>2015-10-28 09:31:41 +0000
committerPaul Buetow (uranus) <paul@buetow.org>2015-10-28 09:31:41 +0000
commit87558274acaefdb852b4f62a09f78bd642de0316 (patch)
treee4bde5fb2ee1cba7638c39ca6c5994105e05aa40 /rubyfy.rb
parent34cdf6c8b15677a63002ebbf29125defccbf9ade (diff)
overwrite outfile on every new run
Diffstat (limited to 'rubyfy.rb')
-rwxr-xr-xrubyfy.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/rubyfy.rb b/rubyfy.rb
index 53ce88f..1df9097 100755
--- a/rubyfy.rb
+++ b/rubyfy.rb
@@ -16,6 +16,7 @@ class Rubyfy
@conf = Hash.new
@log_mutex = Mutex.new
@outfile = nil
+ @outfile_mode = "w"
opts.each do |opt, arg|
opt.sub!(/^-+/, '')
@@ -191,8 +192,9 @@ private
@log_mutex.synchronize do
puts message
if @outfile and severity != :STDOUTONLY
- open(@outfile, "a") do |f|
+ open(@outfile, @outfile_mode) do |f|
f.puts message
+ @outfile_mode = "a"
end
end
end