spud_blog 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,26 +15,26 @@ class SpudPostCategorySweeper < ActionController::Caching::Sweeper
|
|
|
15
15
|
def expire_cache_for(record)
|
|
16
16
|
if Spud::Blog.config.enable_action_caching
|
|
17
17
|
SpudPost.find_each do |p|
|
|
18
|
-
if p.is_news
|
|
18
|
+
if p.is_news && Spud::Blog.config.news_enabled
|
|
19
19
|
expire_action news_post_url(p.url_name)
|
|
20
|
-
|
|
20
|
+
elsif Spud::Blog.config.blog_enabled
|
|
21
21
|
expire_action blog_post_url(p.url_name)
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
|
-
expire_action news_url
|
|
25
|
-
expire_action blog_url
|
|
24
|
+
expire_action news_url if Spud::Blog.config.news_enabled
|
|
25
|
+
expire_action blog_url if Spud::Blog.config.blog_enabled
|
|
26
26
|
expire_action spud_blog_sitemap_url
|
|
27
27
|
end
|
|
28
28
|
if Spud::Blog.config.enable_full_page_caching
|
|
29
29
|
SpudPost.find_each do |p|
|
|
30
|
-
if p.is_news
|
|
30
|
+
if p.is_news && Spud::Blog.config.news_enabled
|
|
31
31
|
expire_page news_post_path(p.url_name)
|
|
32
|
-
|
|
32
|
+
elsif Spud::Blog.config.blog_enabled
|
|
33
33
|
expire_page blog_post_path(p.url_name)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
|
-
expire_page news_path
|
|
37
|
-
expire_page blog_path
|
|
36
|
+
expire_page news_path if Spud::Blog.config.news_enabled
|
|
37
|
+
expire_page blog_path if Spud::Blog.config.blog_enabled
|
|
38
38
|
expire_page spud_blog_sitemap_path(:format => :xml)
|
|
39
39
|
end
|
|
40
40
|
end
|
|
@@ -2,7 +2,11 @@ class SpudPostSweeper < ActionController::Caching::Sweeper
|
|
|
2
2
|
|
|
3
3
|
observe SpudPost
|
|
4
4
|
|
|
5
|
-
def
|
|
5
|
+
def after_create(record)
|
|
6
|
+
expire_cache_for(record)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def before_update(record)
|
|
6
10
|
expire_cache_for(record)
|
|
7
11
|
end
|
|
8
12
|
|
|
@@ -37,7 +41,6 @@ class SpudPostSweeper < ActionController::Caching::Sweeper
|
|
|
37
41
|
expire_page blog_post_path(record.url_name)
|
|
38
42
|
end
|
|
39
43
|
end
|
|
40
|
-
|
|
41
44
|
expire_page spud_sitemap_path(:format => :xml)
|
|
42
45
|
end
|
|
43
46
|
|
data/lib/spud_blog/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spud_blog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.5
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -13,7 +13,7 @@ date: 2012-03-14 00:00:00.000000000 Z
|
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &70287430407040 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ~>
|
|
@@ -21,10 +21,10 @@ dependencies:
|
|
|
21
21
|
version: 3.2.1
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *70287430407040
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: spud_core
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &70287430406340 !ruby/object:Gem::Requirement
|
|
28
28
|
none: false
|
|
29
29
|
requirements:
|
|
30
30
|
- - ~>
|
|
@@ -32,10 +32,10 @@ dependencies:
|
|
|
32
32
|
version: 0.7.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
|
-
version_requirements: *
|
|
35
|
+
version_requirements: *70287430406340
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: spud_permalinks
|
|
38
|
-
requirement: &
|
|
38
|
+
requirement: &70287430404940 !ruby/object:Gem::Requirement
|
|
39
39
|
none: false
|
|
40
40
|
requirements:
|
|
41
41
|
- - ~>
|
|
@@ -43,10 +43,10 @@ dependencies:
|
|
|
43
43
|
version: 0.0.1
|
|
44
44
|
type: :runtime
|
|
45
45
|
prerelease: false
|
|
46
|
-
version_requirements: *
|
|
46
|
+
version_requirements: *70287430404940
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: mysql2
|
|
49
|
-
requirement: &
|
|
49
|
+
requirement: &70287430400680 !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: :development
|
|
56
56
|
prerelease: false
|
|
57
|
-
version_requirements: *
|
|
57
|
+
version_requirements: *70287430400680
|
|
58
58
|
- !ruby/object:Gem::Dependency
|
|
59
59
|
name: rspec
|
|
60
|
-
requirement: &
|
|
60
|
+
requirement: &70287430392240 !ruby/object:Gem::Requirement
|
|
61
61
|
none: false
|
|
62
62
|
requirements:
|
|
63
63
|
- - ! '>='
|
|
@@ -65,10 +65,10 @@ dependencies:
|
|
|
65
65
|
version: '0'
|
|
66
66
|
type: :development
|
|
67
67
|
prerelease: false
|
|
68
|
-
version_requirements: *
|
|
68
|
+
version_requirements: *70287430392240
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: rspec-rails
|
|
71
|
-
requirement: &
|
|
71
|
+
requirement: &70287430390220 !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: :development
|
|
78
78
|
prerelease: false
|
|
79
|
-
version_requirements: *
|
|
79
|
+
version_requirements: *70287430390220
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: factory_girl
|
|
82
|
-
requirement: &
|
|
82
|
+
requirement: &70287430388980 !ruby/object:Gem::Requirement
|
|
83
83
|
none: false
|
|
84
84
|
requirements:
|
|
85
85
|
- - =
|
|
@@ -87,10 +87,10 @@ dependencies:
|
|
|
87
87
|
version: 2.5.0
|
|
88
88
|
type: :development
|
|
89
89
|
prerelease: false
|
|
90
|
-
version_requirements: *
|
|
90
|
+
version_requirements: *70287430388980
|
|
91
91
|
- !ruby/object:Gem::Dependency
|
|
92
92
|
name: mocha
|
|
93
|
-
requirement: &
|
|
93
|
+
requirement: &70287430387680 !ruby/object:Gem::Requirement
|
|
94
94
|
none: false
|
|
95
95
|
requirements:
|
|
96
96
|
- - =
|
|
@@ -98,10 +98,10 @@ dependencies:
|
|
|
98
98
|
version: 0.10.3
|
|
99
99
|
type: :development
|
|
100
100
|
prerelease: false
|
|
101
|
-
version_requirements: *
|
|
101
|
+
version_requirements: *70287430387680
|
|
102
102
|
- !ruby/object:Gem::Dependency
|
|
103
103
|
name: database_cleaner
|
|
104
|
-
requirement: &
|
|
104
|
+
requirement: &70287430386520 !ruby/object:Gem::Requirement
|
|
105
105
|
none: false
|
|
106
106
|
requirements:
|
|
107
107
|
- - =
|
|
@@ -109,7 +109,7 @@ dependencies:
|
|
|
109
109
|
version: 0.7.1
|
|
110
110
|
type: :development
|
|
111
111
|
prerelease: false
|
|
112
|
-
version_requirements: *
|
|
112
|
+
version_requirements: *70287430386520
|
|
113
113
|
description: Spud blogging/news and rss engine.
|
|
114
114
|
email:
|
|
115
115
|
- greg@westlakedesign.com
|
|
@@ -214,7 +214,6 @@ files:
|
|
|
214
214
|
- test/dummy/config/routes.rb
|
|
215
215
|
- test/dummy/config.ru
|
|
216
216
|
- test/dummy/db/schema.rb
|
|
217
|
-
- test/dummy/log/development.log
|
|
218
217
|
- test/dummy/public/404.html
|
|
219
218
|
- test/dummy/public/422.html
|
|
220
219
|
- test/dummy/public/500.html
|
|
@@ -236,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
236
235
|
version: '0'
|
|
237
236
|
segments:
|
|
238
237
|
- 0
|
|
239
|
-
hash:
|
|
238
|
+
hash: 1816796039144768112
|
|
240
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
240
|
none: false
|
|
242
241
|
requirements:
|
|
@@ -245,10 +244,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
245
244
|
version: '0'
|
|
246
245
|
segments:
|
|
247
246
|
- 0
|
|
248
|
-
hash:
|
|
247
|
+
hash: 1816796039144768112
|
|
249
248
|
requirements: []
|
|
250
249
|
rubyforge_project:
|
|
251
|
-
rubygems_version: 1.8.
|
|
250
|
+
rubygems_version: 1.8.10
|
|
252
251
|
signing_key:
|
|
253
252
|
specification_version: 3
|
|
254
253
|
summary: Spud Blog Engine.
|
|
@@ -275,7 +274,6 @@ test_files:
|
|
|
275
274
|
- test/dummy/config/routes.rb
|
|
276
275
|
- test/dummy/config.ru
|
|
277
276
|
- test/dummy/db/schema.rb
|
|
278
|
-
- test/dummy/log/development.log
|
|
279
277
|
- test/dummy/public/404.html
|
|
280
278
|
- test/dummy/public/422.html
|
|
281
279
|
- test/dummy/public/500.html
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
Mysql2::Error: Table 'spud_blog_development.spud_users' doesn't exist: SHOW FULL FIELDS FROM `spud_users`
|
|
2
|
-
Mysql2::Error: Table 'spud_blog_development.spud_users' doesn't exist: SHOW FULL FIELDS FROM `spud_users`
|
|
3
|
-
Mysql2::Error: Table 'spud_blog_development.spud_users' doesn't exist: SHOW FULL FIELDS FROM `spud_users`
|
|
4
|
-
[1m[36m (153.8ms)[0m [1mCREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB[0m
|
|
5
|
-
[1m[35m (287.7ms)[0m CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
|
|
6
|
-
[1m[36m (0.2ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
|
7
|
-
Migrating to CreateSpudPosts (20120125180945)
|
|
8
|
-
[1m[35m (163.8ms)[0m CREATE TABLE `spud_posts` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `title` varchar(255), `content` text, `comments_enabled` tinyint(1) DEFAULT 0, `visible` tinyint(1) DEFAULT 1, `published_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
|
9
|
-
[1m[36m (225.6ms)[0m [1mCREATE INDEX `index_spud_posts_on_spud_user_id` ON `spud_posts` (`spud_user_id`)[0m
|
|
10
|
-
[1m[35m (178.6ms)[0m CREATE INDEX `index_spud_posts_on_visible` ON `spud_posts` (`visible`)
|
|
11
|
-
[1m[36m (0.5ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120125180945')[0m
|
|
12
|
-
Migrating to CreateSpudPostCategories (20120125181022)
|
|
13
|
-
[1m[35m (214.2ms)[0m CREATE TABLE `spud_post_categories` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
|
14
|
-
[1m[36m (209.6ms)[0m [1mCREATE TABLE `spud_post_categories_posts` (`spud_post_id` int(11), `spud_post_category_id` int(11)) ENGINE=InnoDB[0m
|
|
15
|
-
[1m[35m (182.2ms)[0m CREATE INDEX `index_spud_post_categories_posts_on_spud_post_category_id` ON `spud_post_categories_posts` (`spud_post_category_id`)
|
|
16
|
-
[1m[36m (0.6ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120125181022')[0m
|
|
17
|
-
Migrating to CreateSpudPostComments (20120125181359)
|
|
18
|
-
[1m[35m (171.4ms)[0m CREATE TABLE `spud_post_comments` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_post_id` int(11), `author` varchar(255), `content` text, `approved` tinyint(1) DEFAULT 0, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
|
19
|
-
[1m[36m (237.9ms)[0m [1mCREATE INDEX `index_spud_post_comments_on_spud_post_id` ON `spud_post_comments` (`spud_post_id`)[0m
|
|
20
|
-
[1m[35m (227.0ms)[0m CREATE INDEX `index_spud_post_comments_on_approved` ON `spud_post_comments` (`approved`)
|
|
21
|
-
[1m[36m (0.5ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120125181359')[0m
|
|
22
|
-
Migrating to AddUrlToSpudPosts (20120127143054)
|
|
23
|
-
[1m[35m (239.3ms)[0m ALTER TABLE `spud_posts` ADD `url_name` varchar(255)
|
|
24
|
-
[1m[36m (234.5ms)[0m [1mCREATE INDEX `index_spud_posts_on_url_name` ON `spud_posts` (`url_name`)[0m
|
|
25
|
-
[1m[35m (0.6ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120127143054')
|
|
26
|
-
Migrating to AddUrlToSpudPostCategories (20120127144942)
|
|
27
|
-
[1m[36m (196.9ms)[0m [1mALTER TABLE `spud_post_categories` ADD `parent_id` int(11) DEFAULT 0[0m
|
|
28
|
-
[1m[35m (220.7ms)[0m ALTER TABLE `spud_post_categories` ADD `url_name` varchar(255)
|
|
29
|
-
[1m[36m (179.0ms)[0m [1mCREATE INDEX `index_spud_post_categories_on_parent_id` ON `spud_post_categories` (`parent_id`)[0m
|
|
30
|
-
[1m[35m (178.4ms)[0m CREATE INDEX `index_spud_post_categories_on_url_name` ON `spud_post_categories` (`url_name`)
|
|
31
|
-
[1m[36m (0.6ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120127144942')[0m
|
|
32
|
-
Migrating to AddIsNewsToSpudPosts (20120210165540)
|
|
33
|
-
[1m[35m (207.1ms)[0m ALTER TABLE `spud_posts` ADD `is_news` tinyint(1) DEFAULT 0
|
|
34
|
-
[1m[36m (212.3ms)[0m [1mCREATE INDEX `index_spud_posts_on_is_news` ON `spud_posts` (`is_news`)[0m
|
|
35
|
-
[1m[35m (0.8ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120210165540')
|
|
36
|
-
[1m[36m (0.2ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|