padrino-cache 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,8 @@
1
1
  module Padrino
2
2
  module Cache
3
+ ##
4
+ # Helpers supporting page or fragment caching within a request route.
5
+ #
3
6
  module Helpers
4
7
  ##
5
8
  # Page caching is easy to integrate into your application. To turn it on, simply provide the
@@ -82,14 +85,14 @@ module Padrino
82
85
  @route.cache_key = name
83
86
  end
84
87
 
85
- # @api private
88
+ # @private
86
89
  def self.padrino_route_added(route, verb, path, args, options, block) # @private
87
90
  if route.cache and %w(GET HEAD).include?(verb)
88
91
  route.before_filters do
89
92
  if settings.caching?
90
93
  began_at = Time.now
91
94
  value = settings.cache.get(@route.cache_key || env['PATH_INFO'])
92
- logger.debug "GET Cache", began_at, env['PATH_INFO'] if defined?(logger) && value
95
+ logger.debug "GET Cache", began_at, @route.cache_key || env['PATH_INFO'] if defined?(logger) && value
93
96
  halt 200, value if value
94
97
  end
95
98
  end
@@ -103,7 +106,7 @@ module Padrino
103
106
  else
104
107
  settings.cache.set(@route.cache_key || env['PATH_INFO'], @_response_buffer)
105
108
  end
106
- logger.debug "SET Cache", began_at, env['PATH_INFO'] if defined?(logger)
109
+ logger.debug "SET Cache", began_at, @route.cache_key || env['PATH_INFO'] if defined?(logger)
107
110
  end
108
111
  end
109
112
  end
@@ -1,6 +1,10 @@
1
1
  module Padrino
2
2
  module Cache
3
+ ##
4
+ # Defines the available storage adapters for persisting the cache.
5
+ #
3
6
  module Store
7
+ # The defined duration for the expiration edge.
4
8
  EXPIRES_EDGE = 86400
5
9
 
6
10
  autoload :File, 'padrino-cache/store/file'
data/lib/padrino-cache.rb CHANGED
@@ -96,7 +96,7 @@ module Padrino
96
96
  end
97
97
  alias :included :registered
98
98
 
99
- # @api private
99
+ # @private
100
100
  def padrino_route_added(route, verb, path, args, options, block) # @private
101
101
  Padrino::Cache::Helpers::Page.padrino_route_added(route, verb, path, args, options, block)
102
102
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-cache
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 10
9
- - 3
10
- version: 0.10.3
5
+ version: 0.10.4
11
6
  platform: ruby
12
7
  authors:
13
8
  - Padrino Team
@@ -18,8 +13,7 @@ autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
15
 
21
- date: 2011-10-03 00:00:00 -07:00
22
- default_executable:
16
+ date: 2011-10-12 00:00:00 Z
23
17
  dependencies:
24
18
  - !ruby/object:Gem::Dependency
25
19
  name: padrino-core
@@ -29,12 +23,7 @@ dependencies:
29
23
  requirements:
30
24
  - - "="
31
25
  - !ruby/object:Gem::Version
32
- hash: 49
33
- segments:
34
- - 0
35
- - 10
36
- - 3
37
- version: 0.10.3
26
+ version: 0.10.4
38
27
  type: :runtime
39
28
  version_requirements: *id001
40
29
  description: Caching support for memcached, page and fragment
@@ -66,7 +55,6 @@ files:
66
55
  - test/helper.rb
67
56
  - test/test_padrino_cache.rb
68
57
  - test/test_stores.rb
69
- has_rdoc: true
70
58
  homepage: http://www.padrinorb.com
71
59
  licenses: []
72
60
 
@@ -80,25 +68,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
68
  requirements:
81
69
  - - ">="
82
70
  - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
71
  version: "0"
87
72
  required_rubygems_version: !ruby/object:Gem::Requirement
88
73
  none: false
89
74
  requirements:
90
75
  - - ">="
91
76
  - !ruby/object:Gem::Version
92
- hash: 23
93
- segments:
94
- - 1
95
- - 3
96
- - 6
97
77
  version: 1.3.6
98
78
  requirements: []
99
79
 
100
80
  rubyforge_project: padrino-cache
101
- rubygems_version: 1.6.2
81
+ rubygems_version: 1.8.10
102
82
  signing_key:
103
83
  specification_version: 3
104
84
  summary: Page and fragment caching for Padrino