Sha256: ae7bceb62df460f289515f83a6794613f888c42ed940432635a84e126d53a5f5

Contents?: true

Size: 1.18 KB

Versions: 126

Compression:

Stored size: 1.18 KB

Contents

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/development',
               'tmp/cache/assets/test',
               'tmp/cache/assets/production' ]

  tmp_dirs.each { |d| directory d }

  desc "Creates tmp directories for sessions, cache, sockets, and pids"
  task create: tmp_dirs

  namespace :sessions do
    # desc "Clears all files in tmp/sessions"
    task :clear do
      FileUtils.rm(Dir['tmp/sessions/[^.]*'])
    end
  end

  namespace :cache do
    # desc "Clears all files and directories in tmp/cache"
    task :clear do
      FileUtils.rm_rf(Dir['tmp/cache/[^.]*'])
    end
  end

  namespace :sockets do
    # desc "Clears all files in tmp/sockets"
    task :clear do
      FileUtils.rm(Dir['tmp/sockets/[^.]*'])
    end
  end

  namespace :pids do
    # desc "Clears all files in tmp/pids"
    task :clear do
      FileUtils.rm(Dir['tmp/pids/[^.]*'])
    end
  end
end

Version data entries

126 entries across 122 versions & 10 rubygems

Version Path
railties-4.1.7 lib/rails/tasks/tmp.rake
railties-4.0.11 lib/rails/tasks/tmp.rake
railties-4.2.0.beta2 lib/rails/tasks/tmp.rake
nanumfont-rails-0.1 vendor/bundle/ruby/2.1.0/gems/railties-4.1.6/lib/rails/tasks/tmp.rake
railties-4.0.10 lib/rails/tasks/tmp.rake
railties-4.1.6 lib/rails/tasks/tmp.rake
railties-4.1.6.rc2 lib/rails/tasks/tmp.rake
railties-4.0.10.rc2 lib/rails/tasks/tmp.rake
railties-4.2.0.beta1 lib/rails/tasks/tmp.rake
railties-4.1.6.rc1 lib/rails/tasks/tmp.rake
railties-4.0.10.rc1 lib/rails/tasks/tmp.rake
railties-4.0.9 lib/rails/tasks/tmp.rake
railties-4.1.5 lib/rails/tasks/tmp.rake
railties-4.1.4 lib/rails/tasks/tmp.rake
railties-4.0.8 lib/rails/tasks/tmp.rake
railties-4.1.3 lib/rails/tasks/tmp.rake
railties-4.0.7 lib/rails/tasks/tmp.rake
railties-4.0.6 lib/rails/tasks/tmp.rake
railties-4.1.2 lib/rails/tasks/tmp.rake
railties-4.1.2.rc3 lib/rails/tasks/tmp.rake