blog_logic 1.1.5 → 1.1.6

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 CHANGED
@@ -1 +1 @@
1
- 1.1.5
1
+ 1.1.6
@@ -71,7 +71,7 @@ class BlogCategory
71
71
  end
72
72
 
73
73
  def url
74
- "#{Blog.first.path}topics/#{self.slug}/"
74
+ "#{Blog.first.path}topics/#{self.slug}"
75
75
  end
76
76
 
77
77
  private
data/app/models/post.rb CHANGED
@@ -70,7 +70,7 @@ class Post
70
70
  end
71
71
 
72
72
  def humanize_path
73
- "/#{self.slug}/".gsub(/\/\//,'/').gsub(/\/\//,'/')
73
+ "/#{self.slug}".gsub('//', '/')
74
74
  end
75
75
 
76
76
  def my_index
data/app/models/post2.rb CHANGED
@@ -14,6 +14,7 @@ class Post2
14
14
 
15
15
  # Mongoid ========================================================================================
16
16
  field :title
17
+ field :title_short # because "title" is often too long for a decent layout
17
18
  field :content
18
19
  field :tags, :type => Array
19
20
  field :slug
@@ -68,7 +69,7 @@ class Post2
68
69
  end
69
70
 
70
71
  def humanize_path
71
- "/#{self.slug}/".gsub(/\/\//,'/').gsub(/\/\//,'/')
72
+ "/#{self.slug}".gsub('//', '/')
72
73
  end
73
74
 
74
75
  def my_index
@@ -92,7 +93,7 @@ class Post2
92
93
  end
93
94
 
94
95
  def publish!
95
- self.update_attributes(:state => 'published', :publication_date => Time.zone.now)
96
+ self.update_attributes :state => 'published', :published_at => Time.zone.now
96
97
  end
97
98
 
98
99
  def published?
@@ -113,7 +114,7 @@ class Post2
113
114
  end
114
115
 
115
116
  def unpublish!
116
- self.update_attributes :state => 'draft', :publication_date => nil
117
+ self.update_attributes :state => 'draft'
117
118
  end
118
119
 
119
120
  def state=(arg)
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.1.5"
8
+ s.version = "1.1.6"
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-16"
12
+ s.date = "2011-09-21"
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 = [
@@ -10,11 +10,11 @@ describe Post do
10
10
  end
11
11
 
12
12
  it 'returns its relative URL' do
13
- @blog.posts.new(:slug => 'foo').full_path.should == '/my-blog/foo/'
13
+ @blog.posts.new(:slug => 'foo').full_path.should == '/my-blog/foo'
14
14
  end
15
15
 
16
16
  it 'returns its formatted slug' do
17
- @blog.posts.new(:slug => 'foo').humanize_path.should == '/foo/'
17
+ @blog.posts.new(:slug => 'foo').humanize_path.should == '/foo'
18
18
  end
19
19
 
20
20
  it 'publishes, setting its publication date' 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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 5
10
- version: 1.1.5
9
+ - 6
10
+ version: 1.1.6
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-16 00:00:00 Z
18
+ date: 2011-09-21 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bson_ext