From 87558274acaefdb852b4f62a09f78bd642de0316 Mon Sep 17 00:00:00 2001 From: "Paul Buetow (uranus)" Date: Wed, 28 Oct 2015 09:31:41 +0000 Subject: overwrite outfile on every new run --- rubyfy.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rubyfy.rb') 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 -- cgit v1.2.3