From b50bd49aa2d2d01ab05a58674557987386b13774 Mon Sep 17 00:00:00 2001 From: Matt Stopa Date: Tue, 9 Jul 2013 23:19:14 -0600 Subject: Update the filestore documentation for clear [ci skip] --- activesupport/lib/active_support/cache/file_store.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activesupport/lib/active_support/cache/file_store.rb') 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)}) -- cgit v1.2.3