Browse files

Truncate and .gitignore fixes

  • Loading branch information...
1 parent 8a5ddea commit b600e005142a83e4d883ac63792d2c1d76aa2138 Winton Welsh committed Sep 23, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −1 lib/app_helpers/truncate.rb
  2. +0 −1 resources/git/ignore
View
4 lib/app_helpers/truncate.rb
@@ -31,7 +31,9 @@ def truncate(max_length, logger)
module TextNode
def truncate(max_length, logger)
- Hpricot::Text.new(content[/\A.{#{max_length}}\w*\;?/m][/.*[\w\;]/m])
+ content.chars.length < max_length ?
+ Hpricot::Text.new(content) :
+ Hpricot::Text.new(content[/\A.{#{max_length}}\w*\;?/m][/.*[\w\;]/m])
end
end
View
1 resources/git/ignore
@@ -9,6 +9,5 @@ doc/*
log/*
public/cache/**/*
public/media/**/*
-public/images/captcha/*
tmp/**/*
vendor

0 comments on commit b600e00

Please sign in to comment.