Permalink
Browse files

Update the filestore documentation for clear

[ci skip]
  • Loading branch information...
1 parent 69e7e6b commit b50bd49aa2d2d01ab05a58674557987386b13774 @MattStopa MattStopa committed Jul 10, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 activesupport/lib/active_support/cache/file_store.rb
@@ -22,6 +22,9 @@ def initialize(cache_path, options = nil)
extend Strategy::LocalCache
end
+ # Deletes all items from the cache. In this case it deletes all the entries in the specified
+ # file store directory except for .gitkeep. Be careful which directory is specified in your
+ # config file when using +FileStore+ because everything in that directory will be deleted.
def clear(options = nil)
root_dirs = Dir.entries(cache_path).reject {|f| (EXCLUDED_DIRS + [".gitkeep"]).include?(f)}
FileUtils.rm_r(root_dirs.collect{|f| File.join(cache_path, f)})

0 comments on commit b50bd49

Please sign in to comment.