blog_logic 1.3.0 → 1.3.1
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.
- data/VERSION +1 -1
- data/app/models/blog.rb +15 -1
- data/app/models/post.rb +7 -0
- data/app/views/admin/blogs/show.html.erb +2 -2
- data/app/views/admin/posts/index.html.erb +1 -1
- data/app/views/admin/posts/show.html.erb +2 -2
- data/app/views/blogs/feed.rss.builder +3 -3
- data/app/views/blogs/show.html.erb +3 -3
- data/app/views/posts/_index.html.erb +2 -2
- data/app/views/posts/show.html.erb +3 -3
- data/blog_logic.gemspec +2 -2
- data/features/step_definitions/blog_steps.rb +1 -1
- data/spec/models/blog_spec.rb +3 -3
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
data/app/models/blog.rb
CHANGED
@@ -34,14 +34,28 @@ class Blog
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
# Returns this blog's RSS feed.
|
38
|
+
#
|
39
|
+
# @return [String] the RSS feed as a URL path
|
40
|
+
def feed
|
41
|
+
"#{self.path}/feed.rss"
|
42
|
+
end
|
43
|
+
|
44
|
+
# @deprecated Please use {#feed} instead
|
37
45
|
def feed_address
|
38
|
-
"
|
46
|
+
warn "[DEPRECATION] `feed_address` is deprecated. Please use `feed` instead."
|
47
|
+
self.feed
|
39
48
|
end
|
40
49
|
|
50
|
+
# @deprecated Please use {#path} instead
|
41
51
|
def humanize_path
|
52
|
+
warn "[DEPRECATION] `humanize_path` is deprecated. Please use `path` instead."
|
42
53
|
self.path
|
43
54
|
end
|
44
55
|
|
56
|
+
# Returns this blog's path.
|
57
|
+
#
|
58
|
+
# @return [String] the path for this blog
|
45
59
|
def path
|
46
60
|
"/#{self.slug}"
|
47
61
|
end
|
data/app/models/post.rb
CHANGED
@@ -65,11 +65,15 @@ class Post
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
# @deprecated Please use {#path} instead
|
68
69
|
def full_path
|
70
|
+
warn "[DEPRECATION] `full_path` is deprecated. Please use `path` instead."
|
69
71
|
self.path
|
70
72
|
end
|
71
73
|
|
74
|
+
# @deprecated Please use {#path} instead
|
72
75
|
def humanize_path
|
76
|
+
warn "[DEPRECATION] `humanize_path` is deprecated. Please use `path` instead."
|
73
77
|
self.path
|
74
78
|
end
|
75
79
|
|
@@ -83,6 +87,9 @@ class Post
|
|
83
87
|
self.blog.posts[i]
|
84
88
|
end
|
85
89
|
|
90
|
+
# Returns this post's path.
|
91
|
+
#
|
92
|
+
# @return [String] the path for this post
|
86
93
|
def path
|
87
94
|
"#{self.blog.path}/#{self.slug}".gsub('//', '/')
|
88
95
|
end
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<div class="form_column">
|
7
7
|
<%= faux_field 'Blog Title', @blog.title %>
|
8
|
-
<%= faux_field 'URL', @blog.
|
8
|
+
<%= faux_field 'URL', @blog.path %>
|
9
9
|
<%= faux_field 'Posts Per Page', @blog.posts_per_page %>
|
10
10
|
</div>
|
11
11
|
<div class="form_column">
|
12
12
|
<%= faux_field 'RSS Feed', @blog.rss_enabled? ? "Enabled" : "Disabled" %>
|
13
|
-
<%= faux_field 'Feed Address', @blog.
|
13
|
+
<%= faux_field 'Feed Address', @blog.feed %>
|
14
14
|
<%= faux_field 'Description', @blog.description %>
|
15
15
|
</div>
|
16
16
|
<br style="clear: both;" />
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<%- @posts.each do |post| -%>
|
16
16
|
<tr class="<%= cycle('odd', 'even') -%>">
|
17
|
-
<td><%= link_to post.
|
17
|
+
<td><%= link_to post.path, admin_blog_post_path(@blog, post) -%></td>
|
18
18
|
<td>
|
19
19
|
<%= post.title -%><br />
|
20
20
|
<%= post.title_short -%>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="form_column">
|
7
7
|
<%= faux_field 'Title', @post.title -%>
|
8
8
|
<%= faux_field 'Short Title', @post.title_short -%>
|
9
|
-
<%= faux_field 'URL', @post.
|
9
|
+
<%= faux_field 'URL', @post.path -%>
|
10
10
|
</div>
|
11
11
|
<div class="form_column">
|
12
12
|
<%= faux_field 'Publication Date', @post.publication_date.try(:to_s, :concise) -%>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<fieldset class="form_container">
|
28
28
|
<%= legend_tag 'Content' -%>
|
29
29
|
<%- if @post.state == 'published' -%>
|
30
|
-
<iframe src="<%= @post.
|
30
|
+
<iframe src="<%= @post.path -%>" width="100%" height="400" style="background-color: #FFF"></iframe>
|
31
31
|
<%- else -%>
|
32
32
|
<div style="background-color: #FFF; padding: 1em">
|
33
33
|
<%= @post.content.html_safe -%>
|
@@ -3,7 +3,7 @@ xml.rss :version => "2.0" do
|
|
3
3
|
xml.channel do
|
4
4
|
xml.title "#{@blog.title}"
|
5
5
|
xml.description "Latest articles from #{@blog.title}"
|
6
|
-
xml.link "#{@blog.
|
6
|
+
xml.link "#{@blog.feed}"
|
7
7
|
|
8
8
|
@posts.each do |article|
|
9
9
|
xml.item do
|
@@ -11,8 +11,8 @@ xml.rss :version => "2.0" do
|
|
11
11
|
xml.description article.content
|
12
12
|
xml.pubDate article.publication_date.to_s(:rfc822)
|
13
13
|
@url = "#{request.protocol}#{request.host}#{":#{request.port}" if request.port}"
|
14
|
-
xml.link "#{@url}#{article.
|
15
|
-
xml.guid "#{@url}#{article.
|
14
|
+
xml.link "#{@url}#{article.path}"
|
15
|
+
xml.guid "#{@url}#{article.path}"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%- set_title @blog.title -%>
|
2
|
-
<%= auto_discovery_link_tag(:rss, "#{@blog.
|
2
|
+
<%= auto_discovery_link_tag(:rss, "#{@blog.feed}", {:title => "#{@blog.title} Articles RSS"}) if @blog.rss_enabled? -%>
|
3
3
|
|
4
4
|
<p><%= @blog.description -%></p>
|
5
5
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
<div class="blog_links">
|
11
11
|
<ul>
|
12
|
-
<li><%= link_to "Archives", "#{@blog.
|
13
|
-
<li><%= link_to "Search", "#{@blog.
|
12
|
+
<li><%= link_to "Archives", "#{@blog.path}/archive" -%></li>
|
13
|
+
<li><%= link_to "Search", "#{@blog.path}/search" -%></li>
|
14
14
|
</ul>
|
15
15
|
</div>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<ul class="posts">
|
2
2
|
<%- posts.each do |post| -%>
|
3
3
|
<li>
|
4
|
-
<h2><%= link_to post.title, post.
|
4
|
+
<h2><%= link_to post.title, post.path, :title => post.title -%></h2>
|
5
5
|
<%= content_tag(:p, post.publication_date.try(:to_s, :concise), :class => 'publication_date') -%>
|
6
6
|
<%= content_tag(:p, strip_tags(post.summary), :class => 'summary') if show_summary -%></p>
|
7
|
-
<%= link_to "Read More...", post.
|
7
|
+
<%= link_to "Read More...", post.path if show_summary -%>
|
8
8
|
</li>
|
9
9
|
<%- end -%>
|
10
10
|
</ul>
|
@@ -3,9 +3,9 @@
|
|
3
3
|
<%= @post.content.html_safe -%>
|
4
4
|
|
5
5
|
<p>
|
6
|
-
<%= link_to '←'.html_safe, @post.previous_post.
|
7
|
-
<%= link_to 'Back to Blog', @post.blog.
|
8
|
-
<%= link_to '→'.html_safe, @post.next_post.
|
6
|
+
<%= link_to '←'.html_safe, @post.previous_post.path if @post.previous_post -%>
|
7
|
+
<%= link_to 'Back to Blog', @post.blog.path -%>
|
8
|
+
<%= link_to '→'.html_safe, @post.next_post.path if @post.next_post -%>
|
9
9
|
</p>
|
10
10
|
|
11
11
|
<div class="post_meta">
|
data/blog_logic.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "blog_logic"
|
8
|
-
s.version = "1.3.
|
8
|
+
s.version = "1.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bantik"]
|
12
|
-
s.date = "2011-
|
12
|
+
s.date = "2011-10-04"
|
13
13
|
s.description = "An engine for search-engine-optimized blog management."
|
14
14
|
s.email = "corey@seologic.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/spec/models/blog_spec.rb
CHANGED
@@ -7,11 +7,11 @@ describe Blog do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "returns its path" do
|
10
|
-
@blog.
|
10
|
+
@blog.path.should == "/#{@blog.title.to_url}"
|
11
11
|
end
|
12
12
|
|
13
|
-
it "returns its feed
|
14
|
-
@blog.
|
13
|
+
it "returns its RSS feed" do
|
14
|
+
@blog.feed.should == "/#{@blog.title.to_url}/feed.rss"
|
15
15
|
end
|
16
16
|
|
17
17
|
it "retrieves posts by month" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blog_logic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 1
|
10
|
+
version: 1.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bantik
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bson_ext
|