Class: Radiant::Cache::MetaStore

Inherits:
Rack::Cache::MetaStore::Disk
  • Object
show all
Defined in:
lib/radiant/cache.rb

Instance Method Summary collapse

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.meta_stores << self
end

Instance Method Details

#clearObject



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