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.



49
50
51
52
# File 'lib/radiant/cache.rb', line 49

def initialize(root="#{Rails.root}/tmp/cache/meta")
  super
  Radiant::Cache.meta_stores << self
end

Instance Method Details

#clearObject



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