1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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)
This commit is contained in:
Aaron Patterson 2012-08-13 13:27:39 -04:00
parent 52f90ea66f
commit 621e079290

View file

@ -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"