aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/file_store.rb
diff options
context:
space:
mode:
authorMatt Stopa <matthew.p.stopa@gmail.com>2013-07-09 23:19:14 -0600
committerMatt Stopa <matthew.p.stopa@gmail.com>2013-07-09 23:19:14 -0600
commitb50bd49aa2d2d01ab05a58674557987386b13774 (patch)
tree095540e17ece4ddaf0b3fb6f1597e5b4be8df77e /activesupport/lib/active_support/cache/file_store.rb
parent69e7e6ba89cb1f6aef60d5a446a68785a867c9dd (diff)
downloadrails-b50bd49aa2d2d01ab05a58674557987386b13774.tar.gz
rails-b50bd49aa2d2d01ab05a58674557987386b13774.tar.bz2
rails-b50bd49aa2d2d01ab05a58674557987386b13774.zip
Update the filestore documentation for clear
[ci skip]
Diffstat (limited to 'activesupport/lib/active_support/cache/file_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/file_store.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb
index 0c55aa8a32..f93f325012 100644
--- a/activesupport/lib/active_support/cache/file_store.rb
+++ b/activesupport/lib/active_support/cache/file_store.rb
@@ -22,6 +22,9 @@ module ActiveSupport
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)})