diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-04-08 18:56:47 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-04-08 18:56:47 -0300 |
commit | 39c7cb20660de9ea95c35805c9dc802e6a63dad2 (patch) | |
tree | cec0d14248253210d3f1464cdbee02618d497a73 /activesupport/lib/active_support | |
parent | d7505b820fa711d4fe837aa03cd3855cc82ee909 (diff) | |
parent | 16d7cfb17788bdb9e3bd80d6403e98ac515e539c (diff) | |
download | rails-39c7cb20660de9ea95c35805c9dc802e6a63dad2.tar.gz rails-39c7cb20660de9ea95c35805c9dc802e6a63dad2.tar.bz2 rails-39c7cb20660de9ea95c35805c9dc802e6a63dad2.zip |
Merge pull request #19694 from eagletmt/file-store-clear
Allow AS::Cache::FileStore#clear without cache directory
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/cache/file_store.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index d08ecd2f7d..e6a8b84214 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -29,6 +29,7 @@ module ActiveSupport 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)}) + rescue Errno::ENOENT end # Preemptively iterates through all stored keys and removes the ones which have expired. |