Permalink
Browse files

- clean up and catch null case

  • Loading branch information...
1 parent bc9cae7 commit 53e8e47dbe0dab717ae8b8fd6f6325ed1a2cac9c @jordansissel committed Aug 20, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/fpm/source/gem.rb
View
@@ -86,7 +86,8 @@ def get_metadata
end
# make sure we have a description
- self[:description] = [ self[:description], self[:summary], "N/A" ].detect { |t| !t.strip == "" }
+ descriptions = [ self[:description], self[:summary], "#{spec.name} - no description given" ]
+ self[:description] = descriptions.detect { |d| !(d.nil? or d.strip.empty?) }
self[:dependencies] = []
spec.runtime_dependencies.map do |dep|

2 comments on commit 53e8e47

Contributor

ddollar replied Aug 20, 2011

You could also make this:

!d.to_s.strip.empty?

Obviously not important, just a neat trick I like to use.

Owner

jordansissel replied Aug 20, 2011

Ahh, didn't know nil.to_s was "' - nice trick :)

Please sign in to comment.