Module: Radiant::Cache
- Defined in:
- lib/radiant/cache.rb
Class Method Summary collapse
Class Method Details
.clear ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/radiant/cache.rb', line 16 def self.clear [.values + entitystores.values].flatten.each do |store| case store when Rack::Cache::EntityStore::Disk, Rack::Cache::MetaStore::Disk Dir[File.join(store.root, '*')].each do |file| FileUtils.rm_rf(file) end end end end |
.entitystores ⇒ Object
31 32 33 |
# File 'lib/radiant/cache.rb', line 31 def self.entitystores Rack::Cache::Storage.instance.instance_variable_get('@entitystores') end |
.metastores ⇒ Object
27 28 29 |
# File 'lib/radiant/cache.rb', line 27 def self. Rack::Cache::Storage.instance.instance_variable_get('@metastores') end |
.new(backend, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/radiant/cache.rb', line 6 def self.new(backend, = {}) Rack::Cache.new(backend, { :entitystore => "file:tmp/cache/entity", :metastore => "file:tmp/cache/meta", :verbose => false, :allow_reload => false, :allow_revalidate => false }.merge()) end |