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.2.11.3 lib/rails/tasks/tmp.rake
railties-4.2.11.2 lib/rails/tasks/tmp.rake
railties-4.2.11.1 lib/rails/tasks/tmp.rake
railties-4.2.11 lib/rails/tasks/tmp.rake
railties-4.2.10 lib/rails/tasks/tmp.rake
railties-4.2.10.rc1 lib/rails/tasks/tmp.rake
railties-4.2.9 lib/rails/tasks/tmp.rake
railties-4.2.9.rc2 lib/rails/tasks/tmp.rake
railties-4.2.9.rc1 lib/rails/tasks/tmp.rake
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/railties-4.2.8/lib/rails/tasks/tmp.rake
railties-4.2.8 lib/rails/tasks/tmp.rake
railties-4.2.8.rc1 lib/rails/tasks/tmp.rake
railties-4.2.7.1 lib/rails/tasks/tmp.rake
railties-4.2.7 lib/rails/tasks/tmp.rake
railties-4.1.16 lib/rails/tasks/tmp.rake
railties-4.1.16.rc1 lib/rails/tasks/tmp.rake
railties-4.2.7.rc1 lib/rails/tasks/tmp.rake
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/tasks/tmp.rake
railties-4.1.15 lib/rails/tasks/tmp.rake
railties-4.2.6 lib/rails/tasks/tmp.rake