diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-28 16:28:11 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-28 16:28:11 +0000 |
commit | 1c59702464fd2f20e72a5a59a48dc89fc89cb6a3 (patch) | |
tree | 1af5b43bb9fd3a7dc734c1e08b3ef1455214a9c9 /railties/lib/tasks/tmp.rake | |
parent | fed41fbe8b79725904437230ac9e7abfb53df651 (diff) | |
download | rails-1c59702464fd2f20e72a5a59a48dc89fc89cb6a3.tar.gz rails-1c59702464fd2f20e72a5a59a48dc89fc89cb6a3.tar.bz2 rails-1c59702464fd2f20e72a5a59a48dc89fc89cb6a3.zip |
Make clearing follow the object:action naming of the rest of the tasks
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/tasks/tmp.rake')
-rw-r--r-- | railties/lib/tasks/tmp.rake | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/lib/tasks/tmp.rake b/railties/lib/tasks/tmp.rake new file mode 100644 index 0000000000..dcb22f789b --- /dev/null +++ b/railties/lib/tasks/tmp.rake @@ -0,0 +1,27 @@ +namespace :tmp do + desc "Clear session, cache, and socket files from tmp/" + task :clear => [ "tmp:sesions:clear", "tmp:cache:clear", "tmp:sockets:clear"] + + desc "Creates tmp directories for sessions, cache, and sockets" + task :create do + FileUtils.mkdir "tmp" + FileUtils.mkdir "tmp/sessions" + FileUtils.mkdir "tmp/cache" + FileUtils.mkdir "tmp/sockets" + end + + desc "Clears all files in tmp/sessions" + task :clear_sessions do + FileUtils.rm(Dir['tmp/sessions/[^.]*']) + end + + desc "Clears all files and directories in tmp/cache" + task :clear_cache do + FileUtils.rm_rf(Dir['tmp/cache/[^.]*']) + end + + desc "Clears all ruby_sess.* files in tmp/sessions" + task :clear_sockets do + FileUtils.rm(Dir['tmp/sockets/[^.]*']) + end +end
\ No newline at end of file |