Permalink
Browse files

Set a limit on the maximum length of a post file_name.

  • Loading branch information...
1 parent 3e381c9 commit 2c75d477e4e603bb03aa30da931045dad3078d3f @tamouse tamouse committed Jan 15, 2014
Showing with 15 additions and 27 deletions.
  1. +1 −0 .gitignore
  2. +13 −26 Gemfile.lock
  3. +1 −1 lib/planet/post.rb
View
@@ -4,3 +4,4 @@ planet.yml
*.gem
*.gempsec
.gs
+.bundle/
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- planet (0.4.0)
+ planet (0.5.2)
box
feedzirra
gli
@@ -10,34 +10,21 @@ PATH
GEM
remote: http://rubygems.org/
specs:
- activesupport (3.1.10)
- multi_json (>= 1.0, < 1.3)
box (0.1.1)
- builder (3.1.4)
- curb (0.7.18)
- feedzirra (0.1.3)
- activesupport (~> 3.1.1)
- builder (>= 2.1.2)
- curb (~> 0.7.15)
- i18n (>= 0.5.0)
- loofah (~> 1.2.0)
- nokogiri (>= 1.4.4)
- rake (>= 0.8.7)
- rdoc (~> 3.8)
- sax-machine (~> 0.1.0)
- gli (2.5.3)
- i18n (0.6.1)
- json (1.7.6)
+ curb (0.8.5)
+ feedzirra (0.7.0)
+ curb (~> 0.8.1)
+ loofah (~> 1.2.1)
+ sax-machine (~> 0.2.1)
+ gli (2.8.1)
loofah (1.2.1)
nokogiri (>= 1.4.4)
- multi_json (1.2.0)
- mustache (0.99.4)
- nokogiri (1.5.6)
- rake (10.0.3)
- rdoc (3.12)
- json (~> 1.4)
- sax-machine (0.1.0)
- nokogiri (> 0.0.0)
+ mini_portile (0.5.2)
+ mustache (0.99.5)
+ nokogiri (1.6.1)
+ mini_portile (~> 0.5.0)
+ sax-machine (0.2.1)
+ nokogiri (~> 1.6.0)
PLATFORMS
ruby
View
@@ -55,7 +55,7 @@ def file_name
name_date = date ? date.strftime('%Y-%m-%d') : nil
name_title = title.downcase.scan(/\w+/).join('-')
- [name_date, name_title].join('-')
+ [name_date, name_title].join('-')[0..59] # can return a file name that is too long, so truncate here to 60 chars
end
end

0 comments on commit 2c75d47

Please sign in to comment.