diff options
author | Matt Stopa <matthew.p.stopa@gmail.com> | 2013-07-09 23:19:14 -0600 |
---|---|---|
committer | Matt Stopa <matthew.p.stopa@gmail.com> | 2013-07-09 23:19:14 -0600 |
commit | b50bd49aa2d2d01ab05a58674557987386b13774 (patch) | |
tree | 095540e17ece4ddaf0b3fb6f1597e5b4be8df77e /activesupport | |
parent | 69e7e6ba89cb1f6aef60d5a446a68785a867c9dd (diff) | |
download | rails-b50bd49aa2d2d01ab05a58674557987386b13774.tar.gz rails-b50bd49aa2d2d01ab05a58674557987386b13774.tar.bz2 rails-b50bd49aa2d2d01ab05a58674557987386b13774.zip |
Update the filestore documentation for clear
[ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/cache/file_store.rb | 3 |
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)}) |