1. Allan Davis
  2. RubyLearning

Source

RubyLearning / ProjectTrak / vendor / rails / railties / lib / tasks / log.rake

1
2
3
4
5
6
7
8
9
namespace :log do
  desc "Truncates all *.log files in log/ to zero bytes"
  task :clear do
    FileList["log/*.log"].each do |log_file|
      f = File.open(log_file, "w")
      f.close
    end
  end
end