aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-08-13 13:27:39 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2012-08-13 13:28:03 -0400
commit621e0792907686f7d4b82801d97ac8d84d0c9ee0 (patch)
tree6a83c56418e60f70799b0dda5b05e993e6ead795 /railties
parent52f90ea66f22102f721c04802a5f70366719c328 (diff)
downloadrails-621e0792907686f7d4b82801d97ac8d84d0c9ee0.tar.gz
rails-621e0792907686f7d4b82801d97ac8d84d0c9ee0.tar.bz2
rails-621e0792907686f7d4b82801d97ac8d84d0c9ee0.zip
speed up cache directory creation
Let Rake control the cache directories. If the directory already exists, rake will skip creating it (vs the previous task which would always try to mkdir_p)
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/tasks/tmp.rake12
1 files changed, 9 insertions, 3 deletions
diff --git a/railties/lib/rails/tasks/tmp.rake b/railties/lib/rails/tasks/tmp.rake
index 0d6c10328f..093a05b6a4 100644
--- a/railties/lib/rails/tasks/tmp.rake
+++ b/railties/lib/rails/tasks/tmp.rake
@@ -2,10 +2,16 @@ namespace :tmp do
desc "Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear)"
task :clear => [ "tmp:sessions:clear", "tmp:cache:clear", "tmp:sockets:clear"]
+ tmp_dirs = [ 'tmp/sessions',
+ 'tmp/cache',
+ 'tmp/sockets',
+ 'tmp/pids',
+ 'tmp/cache/assets' ]
+
+ tmp_dirs.each { |d| dir d }
+
desc "Creates tmp directories for sessions, cache, sockets, and pids"
- task :create do
- FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets tmp/pids tmp/cache/assets ))
- end
+ task :create => tmp_dirs
namespace :sessions do
# desc "Clears all files in tmp/sessions"