lib/mack-caching.rb in mack-caching-0.7.1.1 vs lib/mack-caching.rb in mack-caching-0.8.0

- old
+ new

@@ -1,37 +1,21 @@ -config_defaults = { - "cachetastic_default_options" => { - "debug" => false, - "adapter" => "local_memory", - "expiry_time" => 300, - "logging" => { - "logger_1" => { - "type" => "file", - "file" => Mack::Paths.log("cachetastic.log") - } - } - } -} +require 'rubygems' +require 'cachetastic' -config = config_defaults +configatron.mack.caching.set_default(:use_page_caching, false) +configatron.cachetastic_default_options.set_default(:debug, false) +configatron.cachetastic_default_options.set_default(:adapter, :local_memory) +configatron.cachetastic_default_options.logging.logger_1.set_default(:type, 'file') +configatron.cachetastic_default_options.logging.logger_1.set_default(:file, Mack::Paths.log('cachetastic.log')) if Mack.env == "production" - config.merge!( - "cachetastic_caches_mack_session_cache_options" => { - "debug" => false, - "adapter" => "file", - "store_options" => - {"dir" => File.join(Mack.root, "tmp")}, - "expiry_time" => 14400, - "logging" => { - "logger_1" => { - "type" => "file", - "file" => Mack::Paths.log("cachetastic_caches_mack_session_cache.log") - } - } - }) + configatron.cachetastic_caches_mack_session_cache_options.set_default(:debug, false) + configatron.cachetastic_caches_mack_session_cache_options.set_default(:adapter, :file) + configatron.cachetastic_caches_mack_session_cache_options.store_options.set_default(:dir, Mack::Paths.tmp) + configatron.cachetastic_caches_mack_session_cache_options.set_default(:expiry_time, 14400) + configatron.cachetastic_caches_mack_session_cache_options.logging.logger_1.set_default(:type, 'file') + configatron.cachetastic_caches_mack_session_cache_options.logging.logger_1.set_default(:file, Mack::Paths.log("cachetastic_caches_mack_session_cache.log")) end -app_config.load_hash(config.merge(app_config.final_configuration_settings), "mack-caching") require File.join(File.dirname(__FILE__), "mack-caching", "sessions", "cachetastic_session_store") require File.join(File.dirname(__FILE__), "mack-caching", "errors") require File.join(File.dirname(__FILE__), "mack-caching", "page_caching", "page_caching") \ No newline at end of file