Skip to content

Commit

Permalink
Merge pull request jordansissel#744 from lnwdr/cpan-author-check
Browse files Browse the repository at this point in the history
Added type checks for cpan authors
  • Loading branch information
jls committed Jul 30, 2014
2 parents 5b0c659 + 55b3991 commit b5c4b26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/fpm/package/cpan.rb
Expand Up @@ -82,8 +82,15 @@ def input(package)
self.name = fix_name(metadata["name"])
end

# Not all things have 'author' listed.
self.vendor = metadata["author"].join(", ") unless metadata["author"].nil?
# author is not always set or it may be a string instead of an array
unless metadata["author"].nil?
if metadata["author"].respond_to?(:to_str)
self.vendor = metadata["author"]
elsif metadata["author"].respond_to?(:to_ary)
self.vendor = metadata["author"].join(", ")
end
end

self.url = metadata["resources"]["homepage"] rescue "unknown"

# TODO(sissel): figure out if this perl module compiles anything
Expand Down

0 comments on commit b5c4b26

Please sign in to comment.