Sha256: 548ff28380b851b63b73393d65a1fb852cf7d906ce6245e0c70ec7eec57ca327
Contents?: true
Size: 521 Bytes
Versions: 116
Compression:
Stored size: 521 Bytes
Contents
namespace :log do desc "Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)" task :clear do log_files.each do |file| clear_log_file(file) end end def log_files if ENV['LOGS'] ENV['LOGS'].split(',') .map { |file| "log/#{file.strip}.log" } .select { |file| File.exist?(file) } else FileList["log/*.log"] end end def clear_log_file(file) f = File.open(file, "w") f.close end end
Version data entries
116 entries across 112 versions & 9 rubygems