Parent

Syckle::Plugins::EMail

Email Plugin

The Email plugin supports the @promote@ action to send out an annoucement to a set of email addresses.

By default it generates an release announcement based on your README.* file.

TODO: Use Ratch’s email command.

Attributes

account[RW]

Email account name (defaults to from).

domain[RW]

User domain (not sure why SMTP requires this?).

file[RW]

Message file to send.

from[RW]

Email address from whom.

login[RW]

Login type (plain, login).

mailto[RW]

List of email addresses to whom to email.

port[RW]

Emails server port (default is usually correct).

secure[RW]

Use TLS/SSL true or false?

server[RW]

Email server.

subject[RW]

Subject line (default is “ANN: title version”).

to[RW]

List of email addresses to whom to email.

to=[RW]

List of email addresses to whom to email.

Public Instance Methods

announce() click to toggle source

Email announcement message.

# File lib/plugins/syckle/email.rb, line 69
def announce
  mailopts = self.mailopts

  if mailto.empty?

  else
    if trial?
      subject = mailopts['subject']
      mailto  = mailopts['to'].flatten.join(", ")
      puts "email '#{subject}' to #{mailto}"
    else
      #emailer = Emailer.new(mailopts)
      #emailer.email
      if mail_confirm?
        email(mailopts)
      end
    end
  end
end
mail_confirm?() click to toggle source

Confirm announcement

# File lib/plugins/syckle/email.rb, line 90
def mail_confirm?
  if mailto
    return true if force?
    to  = [mailto].flatten.join(", ")
    ans = ask("Announce to #{to}?", "(v)iew|(y)es|(N)o")
    case ans.downcase
    when 'y', 'yes'
      true
    when 'v', 'view'
      puts message
      mail_confirm?
    else
      false
    end
  end
end
mailopts() click to toggle source
# File lib/plugins/syckle/email.rb, line 108
def mailopts
  { 'message' => self.message,
    'to'      => self.to,
    'from'    => self.from,
    'subject' => self.subject,
    'server'  => self.server,
    'port'    => self.port,
    'account' => self.account,
    'domain'  => self.domain,
    'login'   => self.login,
    'secure'  => self.secure
  }
end
message() click to toggle source

Message to send. Defaults to a generated release announcement.

# File lib/plugins/syckle/email.rb, line 64
def message
  @message ||= project.announcement(file)
end
secure=(s) click to toggle source

Set if email service is using TLS/SSL security.

# File lib/plugins/syckle/email.rb, line 59
def secure=(s)
  @secure = s.to_b
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.