namespace :logs 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