aboutsummaryrefslogtreecommitdiffstats
path: root/railties/fresh_rakefile
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-13 05:32:21 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-13 05:32:21 +0000
commitecf82d127bb814ff4b9b35fbf177839932d7df65 (patch)
treead190227fdb3472f2a5165ac1d5c3b56aa2afa4d /railties/fresh_rakefile
parent2ad8dc6a1f805315d4a1173fe988e15098c59364 (diff)
downloadrails-ecf82d127bb814ff4b9b35fbf177839932d7df65.tar.gz
rails-ecf82d127bb814ff4b9b35fbf177839932d7df65.tar.bz2
rails-ecf82d127bb814ff4b9b35fbf177839932d7df65.zip
Added Rake target clear_logs that'll truncate all the *.log files in log/ to zero #1079 [Lucas Carlson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/fresh_rakefile')
-rwxr-xr-xrailties/fresh_rakefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile
index b6991bf076..b563af722b 100755
--- a/railties/fresh_rakefile
+++ b/railties/fresh_rakefile
@@ -178,3 +178,11 @@ task :purge_test_database => :environment do
raise "Unknown database adapter '#{abcs["test"]["adapter"]}'"
end
end
+
+desc "Clears all *.log files in log/"
+task :clear_logs => :environment do
+ FileList["log/*.log"].each do |log_file|
+ f = File.open(log_file, "w")
+ f.close
+ end
+end \ No newline at end of file