Skip to content

Instantly share code, notes, and snippets.

@shadowmaru
Created August 23, 2009 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shadowmaru/173506 to your computer and use it in GitHub Desktop.
Save shadowmaru/173506 to your computer and use it in GitHub Desktop.
module ActionController
module Caching
class Sweeper
def sweep_directory(dirs)
dirs.each do |dir|
cache_dir = RAILS_ROOT + "/public/#{dir}"
FileUtils.rm_r(Dir.glob(cache_dir+"/*")) rescue Errno::ENOENT
RAILS_DEFAULT_LOGGER.info("Cache directory '#{cache_dir}' fully swept.")
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment