mack-caching 0.7.1.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,7 +1,7 @@
1
1
  == Page Caching
2
2
 
3
3
  Using page caching with Mack, is incredibly easy. The first thing you
4
- need to do is turn it on. In the app_config/*.yml file of your chosing
4
+ need to do is turn it on. In the configatron/*.rb file of your chosing
5
5
  place the following configuration setting:
6
6
 
7
7
  use_page_caching: true
@@ -9,7 +9,7 @@ module Mack # :nodoc:
9
9
  end
10
10
 
11
11
  def call(env) # :nodoc:
12
- if app_config.use_page_caching
12
+ if configatron.mack.caching.use_page_caching
13
13
  request = Mack::Request.new(env)
14
14
  page = Cachetastic::Caches::PageCache.get(request.fullpath)
15
15
  if page
data/lib/mack-caching.rb CHANGED
@@ -1,36 +1,20 @@
1
- config_defaults = {
2
- "cachetastic_default_options" => {
3
- "debug" => false,
4
- "adapter" => "local_memory",
5
- "expiry_time" => 300,
6
- "logging" => {
7
- "logger_1" => {
8
- "type" => "file",
9
- "file" => Mack::Paths.log("cachetastic.log")
10
- }
11
- }
12
- }
13
- }
1
+ require 'rubygems'
2
+ require 'cachetastic'
14
3
 
15
- config = config_defaults
4
+ configatron.mack.caching.set_default(:use_page_caching, false)
5
+ configatron.cachetastic_default_options.set_default(:debug, false)
6
+ configatron.cachetastic_default_options.set_default(:adapter, :local_memory)
7
+ configatron.cachetastic_default_options.logging.logger_1.set_default(:type, 'file')
8
+ configatron.cachetastic_default_options.logging.logger_1.set_default(:file, Mack::Paths.log('cachetastic.log'))
16
9
 
17
10
  if Mack.env == "production"
18
- config.merge!(
19
- "cachetastic_caches_mack_session_cache_options" => {
20
- "debug" => false,
21
- "adapter" => "file",
22
- "store_options" =>
23
- {"dir" => File.join(Mack.root, "tmp")},
24
- "expiry_time" => 14400,
25
- "logging" => {
26
- "logger_1" => {
27
- "type" => "file",
28
- "file" => Mack::Paths.log("cachetastic_caches_mack_session_cache.log")
29
- }
30
- }
31
- })
11
+ configatron.cachetastic_caches_mack_session_cache_options.set_default(:debug, false)
12
+ configatron.cachetastic_caches_mack_session_cache_options.set_default(:adapter, :file)
13
+ configatron.cachetastic_caches_mack_session_cache_options.store_options.set_default(:dir, Mack::Paths.tmp)
14
+ configatron.cachetastic_caches_mack_session_cache_options.set_default(:expiry_time, 14400)
15
+ configatron.cachetastic_caches_mack_session_cache_options.logging.logger_1.set_default(:type, 'file')
16
+ configatron.cachetastic_caches_mack_session_cache_options.logging.logger_1.set_default(:file, Mack::Paths.log("cachetastic_caches_mack_session_cache.log"))
32
17
  end
33
- app_config.load_hash(config.merge(app_config.final_configuration_settings), "mack-caching")
34
18
 
35
19
 
36
20
  require File.join(File.dirname(__FILE__), "mack-caching", "sessions", "cachetastic_session_store")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mack-caching
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - markbates
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-14 00:00:00 -04:00
12
+ date: 2008-10-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.7.4
23
+ version: 2.0.0
24
24
  version:
25
25
  description: "mack-caching was developed by: markbates"
26
26
  email: mark@mackframework.com
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  requirements: []
63
63
 
64
64
  rubyforge_project: magrathea
65
- rubygems_version: 1.2.0
65
+ rubygems_version: 1.3.0
66
66
  signing_key:
67
67
  specification_version: 2
68
68
  summary: Caching extensions for Mack