Class: Radiant::Cache::MetaStore
- Inherits:
-
Rack::Cache::MetaStore::Disk
- Object
- Rack::Cache::MetaStore::Disk
- Radiant::Cache::MetaStore
- Defined in:
- lib/radiant/cache.rb
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(root = "#{Rails.root}/tmp/cache/meta") ⇒ MetaStore
constructor
A new instance of MetaStore.
- #store(request, response, entitystore) ⇒ Object
Constructor Details
#initialize(root = "#{Rails.root}/tmp/cache/meta") ⇒ MetaStore
Returns a new instance of MetaStore.
50 51 52 53 |
# File 'lib/radiant/cache.rb', line 50 def initialize(root="#{Rails.root}/tmp/cache/meta") super Radiant::Cache. << self end |
Instance Method Details
#clear ⇒ Object
55 56 57 |
# File 'lib/radiant/cache.rb', line 55 def clear Dir[File.join(self.root, "*")].each {|file| FileUtils.rm_rf(file) } end |
#store(request, response, entitystore) ⇒ Object
59 60 61 62 63 |
# File 'lib/radiant/cache.rb', line 59 def store(request, response, entitystore) # Verify that the cache directory exists before attempting to store FileUtils.mkdir_p(self.root, :mode => 0755) unless File.directory?(self.root) super end |