lib/sup/account.rb in sup-0.11 vs lib/sup/account.rb in sup-0.12
- old
+ new
@@ -1,16 +1,17 @@
module Redwood
class Account < Person
- attr_accessor :sendmail, :signature
+ attr_accessor :sendmail, :signature, :gpgkey
def initialize h
raise ArgumentError, "no name for account" unless h[:name]
raise ArgumentError, "no email for account" unless h[:email]
super h[:name], h[:email]
@sendmail = h[:sendmail]
@signature = h[:signature]
+ @gpgkey = h[:gpgkey]
end
# Default sendmail command for bouncing mail,
# deduced from #sendmail
def bounce_sendmail
@@ -44,10 +45,10 @@
## must be called first with the default account. fills in missing
## values from the default account.
def add_account hash, default=false
raise ArgumentError, "no email specified for account" unless hash[:email]
unless default
- [:name, :sendmail, :signature].each { |k| hash[k] ||= @default_account.send(k) }
+ [:name, :sendmail, :signature, :gpgkey].each { |k| hash[k] ||= @default_account.send(k) }
end
hash[:alternates] ||= []
[:name, :signature].each { |x| hash[x].force_encoding Encoding::UTF_8 if hash[x].respond_to? :encoding }