aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/file_store.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2008-05-16 19:10:30 +0200
committerPratik Naik <pratiknaik@gmail.com>2008-05-19 10:38:59 +0100
commit99860b72aebe0348f41e82d4710343498d89a84b (patch)
tree56457862ab6ce523cfb7d6dacd9f38655ab8c715 /activesupport/lib/active_support/cache/file_store.rb
parent17d1319c480e58e28641b243da50ae5e5eab89dc (diff)
downloadrails-99860b72aebe0348f41e82d4710343498d89a84b.tar.gz
rails-99860b72aebe0348f41e82d4710343498d89a84b.tar.bz2
rails-99860b72aebe0348f41e82d4710343498d89a84b.zip
Add fragment_exist? and exist? methods to cache stores. [#203 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/cache/file_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/file_store.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb
index 16a2509ce2..5b771b1da0 100644
--- a/activesupport/lib/active_support/cache/file_store.rb
+++ b/activesupport/lib/active_support/cache/file_store.rb
@@ -40,13 +40,18 @@ module ActiveSupport
end
end
+ def exist?(name, options = nil)
+ super
+ File.exist?(real_file_path(name))
+ end
+
private
def real_file_path(name)
'%s/%s.cache' % [@cache_path, name.gsub('?', '.').gsub(':', '.')]
end
def ensure_cache_path(path)
- FileUtils.makedirs(path) unless File.exists?(path)
+ FileUtils.makedirs(path) unless File.exist?(path)
end
def search_dir(dir, &callback)