blog_logic 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
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
- "/#{self.slug}/feed.rss"
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.humanize_path %>
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.feed_address %>
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.full_path, admin_blog_post_path(@blog, post) -%></td>
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.full_path -%>
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.full_path -%>" width="100%" height="400" style="background-color: #FFF"></iframe>
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.feed_address}"
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.full_path}"
15
- xml.guid "#{@url}#{article.full_path}"
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.feed_address}", {:title => "#{@blog.title} Articles RSS"}) if @blog.rss_enabled? -%>
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.humanize_path}archive" -%></li>
13
- <li><%= link_to "Search", "#{@blog.humanize_path}search" -%></li>
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.full_path, :title => post.title -%></h2>
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.full_path if show_summary -%>
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 '&larr;'.html_safe, @post.previous_post.full_path if @post.previous_post -%>
7
- <%= link_to 'Back to Blog', @post.blog.humanize_path -%>
8
- <%= link_to '&rarr;'.html_safe, @post.next_post.full_path if @post.next_post -%>
6
+ <%= link_to '&larr;'.html_safe, @post.previous_post.path if @post.previous_post -%>
7
+ <%= link_to 'Back to Blog', @post.blog.path -%>
8
+ <%= link_to '&rarr;'.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.0"
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-09-30"
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 = [
@@ -11,7 +11,7 @@ When /^I visit the blog archive page$/ do
11
11
  end
12
12
 
13
13
  When /^I visit the blog RSS feed$/ do
14
- visit Blog.first.feed_address
14
+ visit Blog.first.feed
15
15
  end
16
16
 
17
17
  Given /^I have a blog "([^"]*)"$/ do |title|
@@ -7,11 +7,11 @@ describe Blog do
7
7
  end
8
8
 
9
9
  it "returns its path" do
10
- @blog.humanize_path.should == "/#{@blog.title.to_url}"
10
+ @blog.path.should == "/#{@blog.title.to_url}"
11
11
  end
12
12
 
13
- it "returns its feed address" do
14
- @blog.feed_address.should == "/#{@blog.title.to_url}/feed.rss"
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 0
10
- version: 1.3.0
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-09-30 00:00:00 Z
18
+ date: 2011-10-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bson_ext