Skip to content

Instantly share code, notes, and snippets.

View khansensf's full-sized avatar

Ken Hansen khansensf

  • San Francisco, CA
View GitHub Profile
@khansensf
khansensf / admin-cleanup.rake
Created February 1, 2012 01:24 — forked from chriskottom/admin-cleanup.rake
simple Rake task for cleanup of Rails directory
namespace :admin do
desc "Clean up all temporary files in the application directory"
task :cleanup, :needs => :environment do
puts "Removing temporary directory contents"
tmp_files = []
%w{ cache pids sessions sockets }.each do |dir|
tmp_files += Dir.glob( File.join(Rails.root, "tmp", dir, "*") )
end
File.delete(*tmp_files)