toto 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/lib/toto.rb +4 -3
  3. data/test/toto_test.rb +1 -1
  4. data/toto.gemspec +2 -2
  5. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -190,11 +190,12 @@ module Toto
190
190
  def summary length = nil
191
191
  length ||= (config = @config[:summary]).is_a?(Hash) ? config[:max] : config
192
192
 
193
- if self[:body] =~ config[:delim]
194
- markdown self[:body].split(config[:delim]).first
193
+ sum = if self[:body] =~ config[:delim]
194
+ self[:body].split(config[:delim]).first
195
195
  else
196
- markdown self[:body].match(/(.{1,#{length}}.*?)(\n|\Z)/m).to_s
196
+ self[:body].match(/(.{1,#{length}}.*?)(\n|\Z)/m).to_s
197
197
  end
198
+ markdown(sum.length == self[:body].length ? sum : sum.strip.sub(/\.$/, '…'))
198
199
  end
199
200
 
200
201
  def url
@@ -131,7 +131,7 @@ context Toto do
131
131
  should("use the author") { topic.author }.equals "toetoe"
132
132
 
133
133
  context "and long first paragraph" do
134
- should("create a valid summary") { topic.summary }.equals "<p>" + "a little bit of text." * 5 + "</p>\n"
134
+ should("create a valid summary") { topic.summary }.equals "<p>" + ("a little bit of text." * 5).chop + "&hellip;</p>\n"
135
135
  end
136
136
 
137
137
  context "and a short first paragraph" do
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{toto}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["cloudhead"]
12
- s.date = %q{2010-01-25}
12
+ s.date = %q{2010-01-26}
13
13
  s.description = %q{the tiniest blog-engine in Oz.}
14
14
  s.email = %q{self@cloudhead.net}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - cloudhead
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-25 00:00:00 -05:00
12
+ date: 2010-01-26 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency