Permalink
Browse files

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
  • Loading branch information...
1 parent 2ad8dc6 commit ecf82d127bb814ff4b9b35fbf177839932d7df65 @dhh dhh committed Apr 13, 2005
Showing with 10 additions and 0 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +8 −0 railties/fresh_rakefile
View
@@ -1,5 +1,7 @@
*SVN*
+* Added Rake target clear_logs that'll truncate all the *.log files in log/ to zero #1079 [Lucas Carlson]
+
* Added lazy typing for generate, such that ./script/generate cn == ./script/generate controller and the likes #1051 [k@v2studio.com]
* Fixed that ownership is brought over in pg_dump during tests for PostgreSQL #1060 [pburleson@gmail.com]
View
@@ -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

0 comments on commit ecf82d1

Please sign in to comment.