Created
August 23, 2009 22:53
-
-
Save shadowmaru/173506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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