Class: Reap::Hosts::Mailinglist
- Defined in:
- lib/reap/hosts/mailinglist.rb
Overview
Mailinglist
Gerneic Mailing list “host”. Mailinglist hosts support the @announce@ task.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Tool
Instance Method Summary collapse
-
#announce(options) ⇒ Object
Email message.
-
#announce_confirm?(options) ⇒ Boolean
Confirm announcement.
- #announce_options(options) ⇒ Object
Methods inherited from Host
factory, inherited, #inspect, register, registry, #release_confirm?
Methods inherited from Tool
#debug?, #dryrun?, #force?, from_project, #initialize, #metadata, #trace?, #verbose?
Methods included from Utilities
#ask, #bin?, #cd, #command_paths, #compress, #dir!, #dir?, directory!, directory?, #email, exist!, exist?, #exists!, #exists?, #file!, #file?, #fileutils, #glob, #list_option, #multiglob, #multiglob_r, #out_of_date?, #password, path!, path?, #read, #rm_r, #safe?, #sh, #stage, #stage_manifest, #status, #write, #ziputils
Constructor Details
This class inherits a constructor from Reap::Tool
Instance Method Details
#announce(options) ⇒ Object
Email message. Options are:
message Message to send.
mailto Email address to whom to mail.
from Email address from whom.
subject Subject line (default is "ANN: project version").
server Email server
port Emails server port (default is usually correct).
account Email account name (defaults to from).
domain User domain (not sure why SMTP requires this?)
login Login type (plain, login)
secure Use TLS/SSL true or false?
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/reap/hosts/mailinglist.rb', line 29 def announce() = () subject = [:subject] mailto = [:mailto] || [:to] to = [mailto].flatten.join(", ") if dryrun? puts "email '#{subject}' to #{to}" else emailer = Emailer.new() emailer.email end end |
#announce_confirm?(options) ⇒ Boolean
Confirm announcement
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/reap/hosts/mailinglist.rb', line 46 def announce_confirm?() = () if mailto = [:mailto] || [:to] return true if force? to = [mailto].flatten.join(", ") ans = ask("Announce to #{to}?", "yN") case ans.downcase when 'y', 'yes' true else false end end end |
#announce_options(options) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/reap/hosts/mailinglist.rb', line 64 def () = .rekey environ = Emailer. defaults = project.defaults['email'].rekey result = {} result.update(defaults) result.update(environ) result.update() result[:subject] = (result[:subject] % [.unixname, .version]) result end |