radiant-cache_by_page-extension 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -30,9 +30,9 @@ module CacheByPage::PageExtensions
30
30
  else
31
31
  ResponseCache.defaults[:expire_time]
32
32
  end
33
- when @page.cache_expire_minutes == -1: nil
34
- when @page.cache_expire_minutes >= 1: @page.cache_expire_minutes.minutes
35
- when @page.cache_expire_time != nil && @page.cache_expire_time.is_a?(Time)
33
+ when @page.cache_expire_minutes == -1 then nil
34
+ when @page.cache_expire_minutes >= 1 then @page.cache_expire_minutes.minutes
35
+ when @page.cache_expire_time != nil && @page.cache_expire_time.is_a?(Time) then
36
36
  next_expire_time = @page.cache_expire_time < Time.now ? @page.cache_expire_time.tomorrow : @page.cache_expire_time
37
37
  (next_expire_time - Time.now).round
38
38
  else nil
@@ -41,11 +41,11 @@ module CacheByPage::PageExtensions
41
41
  def cache_setting
42
42
  @page = Page.find(self.id)
43
43
  case true
44
- when @page.cache_expire_minutes == 0 && @page.cache_expire_time == nil: Page.default_caching
45
- when @page.cache_expire_minutes == -1: "No Caching"
46
- when @page.cache_expire_minutes == 1: "1 minute"
47
- when @page.cache_expire_minutes > 1: "#{@page.cache_expire_minutes} minutes"
48
- when @page.cache_expire_time != nil && @page.cache_expire_time.is_a?(Time)
44
+ when @page.cache_expire_minutes == 0 && @page.cache_expire_time == nil then Page.default_caching
45
+ when @page.cache_expire_minutes == -1 then "No Caching"
46
+ when @page.cache_expire_minutes == 1 then "1 minute"
47
+ when @page.cache_expire_minutes > 1 then "#{@page.cache_expire_minutes} minutes"
48
+ when @page.cache_expire_time != nil && @page.cache_expire_time.is_a?(Time) then
49
49
  "Daily at #{@page.cache_expire_time.strftime("%H")}:#{@page.cache_expire_time.strftime("%M")}"
50
50
  else "Not set"
51
51
  end
@@ -70,14 +70,10 @@ module CacheByPage::PageExtensions
70
70
  def default_caching
71
71
  seconds = SiteController.respond_to?('cache_timeout') ? SiteController.cache_timeout : ResponseCache.defaults[:expire_time]
72
72
  cache_expire_time = case true
73
- when seconds >= 86400
74
- "#{seconds/86400} days"
75
- when seconds >= 3600
76
- "#{seconds/3600} hours"
77
- when seconds >= 120
78
- "#{seconds/60} minutes"
79
- else
80
- "#{seconds} seconds"
73
+ when seconds >= 86400 then "#{seconds/86400} days"
74
+ when seconds >= 3600 then "#{seconds/3600} hours"
75
+ when seconds >= 120 then "#{seconds/60} minutes"
76
+ else "#{seconds} seconds"
81
77
  end
82
78
  cache_expire_time = cache_expire_time.chop if cache_expire_time[0,1] == "1"
83
79
  cache_expire_time
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{radiant-cache_by_page-extension}
8
- s.version = "1.0.1"
7
+ s.name = "radiant-cache_by_page-extension"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew vonderLuft"]
12
- s.date = %q{2011-06-23}
13
- s.description = %q{Enables per page admin option of setting caching to a non-default value, or turning it off altogether.}
14
- s.email = %q{avonderluft@avlux.net}
12
+ s.date = "2012-02-06"
13
+ s.description = "Enables per page admin option of setting caching to a non-default value, or turning it off altogether."
14
+ s.email = "avonderluft@avlux.net"
15
15
  s.extra_rdoc_files = [
16
16
  "README.textile"
17
17
  ]
@@ -36,10 +36,10 @@ Gem::Specification.new do |s|
36
36
  "spec/spec.opts",
37
37
  "spec/spec_helper.rb"
38
38
  ]
39
- s.homepage = %q{https://github.com/avonderluft/radiant-cache_by_page-extension}
39
+ s.homepage = "https://github.com/avonderluft/radiant-cache_by_page-extension"
40
40
  s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.6.2}
42
- s.summary = %q{Cache By Page Extension for Radiant CMS}
41
+ s.rubygems_version = "1.8.10"
42
+ s.summary = "Cache By Page Extension for Radiant CMS"
43
43
  s.test_files = [
44
44
  "spec/controllers/admin_pages_controller_spec.rb",
45
45
  "spec/controllers/site_controller_extensions_spec.rb",
metadata CHANGED
@@ -1,48 +1,40 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: radiant-cache_by_page-extension
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 1
10
- version: 1.0.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Andrew vonderLuft
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-23 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-02-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: radiant
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 57
29
- segments:
30
- - 0
31
- - 9
32
- - 1
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 0.9.1
34
- name: radiant
35
- version_requirements: *id001
22
+ type: :runtime
36
23
  prerelease: false
37
- description: Enables per page admin option of setting caching to a non-default value, or turning it off altogether.
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.9.1
30
+ description: Enables per page admin option of setting caching to a non-default value,
31
+ or turning it off altogether.
38
32
  email: avonderluft@avlux.net
39
33
  executables: []
40
-
41
34
  extensions: []
42
-
43
- extra_rdoc_files:
35
+ extra_rdoc_files:
44
36
  - README.textile
45
- files:
37
+ files:
46
38
  - HELP_admin.textile
47
39
  - README.textile
48
40
  - Rakefile
@@ -62,41 +54,31 @@ files:
62
54
  - spec/models/page_extensions_spec.rb
63
55
  - spec/spec.opts
64
56
  - spec/spec_helper.rb
65
- has_rdoc: true
66
57
  homepage: https://github.com/avonderluft/radiant-cache_by_page-extension
67
58
  licenses: []
68
-
69
59
  post_install_message:
70
60
  rdoc_options: []
71
-
72
- require_paths:
61
+ require_paths:
73
62
  - lib
74
- required_ruby_version: !ruby/object:Gem::Requirement
63
+ required_ruby_version: !ruby/object:Gem::Requirement
75
64
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- hash: 3
80
- segments:
81
- - 0
82
- version: "0"
83
- required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
70
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
92
75
  requirements: []
93
-
94
76
  rubyforge_project:
95
- rubygems_version: 1.6.2
77
+ rubygems_version: 1.8.21
96
78
  signing_key:
97
79
  specification_version: 3
98
80
  summary: Cache By Page Extension for Radiant CMS
99
- test_files:
81
+ test_files:
100
82
  - spec/controllers/admin_pages_controller_spec.rb
101
83
  - spec/controllers/site_controller_extensions_spec.rb
102
84
  - spec/integration/page_caching_spec.rb