lib/sup/account.rb in sup-0.13.2.1 vs lib/sup/account.rb in sup-0.14.0
- old
+ new
@@ -48,11 +48,12 @@
raise ArgumentError, "no email specified for account" unless hash[:email]
unless default
[:name, :sendmail, :signature, :gpgkey].each { |k| hash[k] ||= @default_account.send(k) }
end
hash[:alternates] ||= []
+ fail "alternative emails are not an array: #{hash[:alternates]}" unless hash[:alternates].kind_of? Array
- [:name, :signature].each { |x| hash[x].force_encoding Encoding::UTF_8 if hash[x].respond_to? :encoding }
+ [:name, :signature].each { |x| hash[x] ? hash[x].fix_encoding : nil }
a = Account.new hash
@accounts[a] = true
if default