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.
49 50 51 52 |
# File 'lib/radiant/cache.rb', line 49 def initialize(root="#{Rails.root}/tmp/cache/meta") super Radiant::Cache. << self end |
Instance Method Details
#clear ⇒ Object
54 55 56 |
# File 'lib/radiant/cache.rb', line 54 def clear Dir[File.join(self.root, "*")].each {|file| FileUtils.rm_rf(file) } end |
#store(request, response, entitystore) ⇒ Object
58 59 60 61 62 |
# File 'lib/radiant/cache.rb', line 58 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 |