manifest-rails 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,7 @@ class Manifest::ContentBlocksController < Manifest::ManifestController
13
13
  @content_block = ContentBlock.new(content_block_params)
14
14
 
15
15
  if @content_block.save
16
+ expire_all_pages
16
17
  redirect_to manifest_content_blocks_path
17
18
  else
18
19
  render 'new'
@@ -27,6 +28,7 @@ class Manifest::ContentBlocksController < Manifest::ManifestController
27
28
  @content_block = ContentBlock.find(params[:id])
28
29
 
29
30
  if @content_block.update_attributes(content_block_params)
31
+ expire_all_pages
30
32
  redirect_to manifest_content_blocks_path
31
33
  else
32
34
  render 'edit'
@@ -37,6 +39,8 @@ class Manifest::ContentBlocksController < Manifest::ManifestController
37
39
  @content_block = ContentBlock.find(params[:id])
38
40
  @content_block.destroy
39
41
 
42
+ expire_all_pages
43
+
40
44
  redirect_to manifest_content_blocks_path
41
45
  end
42
46
 
@@ -18,4 +18,12 @@ class Manifest::ManifestController < ApplicationController
18
18
  def authorize_admin
19
19
  redirect_to manifest_path, alert: 'Admins only' unless current_editor.admin?
20
20
  end
21
+
22
+ def expire_all_pages
23
+ expire_page '/index.html'
24
+
25
+ Page.all.each do |p|
26
+ expire_page "/#{p.slug}.html"
27
+ end
28
+ end
21
29
  end
@@ -1,6 +1,8 @@
1
1
  class PagesController < ApplicationController
2
2
  layout 'public'
3
3
 
4
+ caches_page :show
5
+
4
6
  def show
5
7
  render @page.slug if @page = Page.find(params[:id])
6
8
  end
@@ -1,3 +1,3 @@
1
1
  module Manifest
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manifest-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &2152301720 !ruby/object:Gem::Requirement
16
+ requirement: &2152401420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152301720
24
+ version_requirements: *2152401420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: friendly_id
27
- requirement: &2152300400 !ruby/object:Gem::Requirement
27
+ requirement: &2152398480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152300400
35
+ version_requirements: *2152398480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sass-rails
38
- requirement: &2152298820 !ruby/object:Gem::Requirement
38
+ requirement: &2152414440 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.2.3
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152298820
46
+ version_requirements: *2152414440
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: compass-rails
49
- requirement: &2152297940 !ruby/object:Gem::Requirement
49
+ requirement: &2152412820 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2152297940
57
+ version_requirements: *2152412820
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bcrypt-ruby
60
- requirement: &2152297180 !ruby/object:Gem::Requirement
60
+ requirement: &2152410980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 3.0.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2152297180
68
+ version_requirements: *2152410980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tinymce-rails
71
- requirement: &2152296580 !ruby/object:Gem::Requirement
71
+ requirement: &2152409700 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2152296580
79
+ version_requirements: *2152409700
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sqlite3
82
- requirement: &2152270080 !ruby/object:Gem::Requirement
82
+ requirement: &2152430160 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2152270080
90
+ version_requirements: *2152430160
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec-rails
93
- requirement: &2152269420 !ruby/object:Gem::Requirement
93
+ requirement: &2152427520 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2152269420
101
+ version_requirements: *2152427520
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: factory_girl_rails
104
- requirement: &2152268500 !ruby/object:Gem::Requirement
104
+ requirement: &2152425600 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2152268500
112
+ version_requirements: *2152425600
113
113
  description: Manifest allows for the creation of simple content management with support
114
114
  for easy custom data types. It attempts to preserve the Rails way of working where
115
115
  possible.
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: -4432347159213337410
193
+ hash: 1948746640703504455
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  none: false
196
196
  requirements:
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: -4432347159213337410
202
+ hash: 1948746640703504455
203
203
  requirements: []
204
204
  rubyforge_project:
205
205
  rubygems_version: 1.8.15