Class: Reporter::Mail
- Inherits:
-
Object
- Object
- Reporter::Mail
- Defined in:
- lib/depengine/reporter/mail.rb
Instance Attribute Summary collapse
-
#application_name ⇒ Object
Returns the value of attribute application_name.
-
#deploy_email_from ⇒ Object
Returns the value of attribute deploy_email_from.
-
#deploy_email_to ⇒ Object
Returns the value of attribute deploy_email_to.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
-
#version ⇒ Object
Returns the value of attribute version.
-
#worker ⇒ Object
Returns the value of attribute worker.
Instance Method Summary collapse
Instance Attribute Details
#application_name ⇒ Object
Returns the value of attribute application_name.
5 6 7 |
# File 'lib/depengine/reporter/mail.rb', line 5 def application_name @application_name end |
#deploy_email_from ⇒ Object
Returns the value of attribute deploy_email_from.
3 4 5 |
# File 'lib/depengine/reporter/mail.rb', line 3 def deploy_email_from @deploy_email_from end |
#deploy_email_to ⇒ Object
Returns the value of attribute deploy_email_to.
4 5 6 |
# File 'lib/depengine/reporter/mail.rb', line 4 def deploy_email_to @deploy_email_to end |
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/depengine/reporter/mail.rb', line 7 def environment @environment end |
#module_name ⇒ Object
Returns the value of attribute module_name.
6 7 8 |
# File 'lib/depengine/reporter/mail.rb', line 6 def module_name @module_name end |
#version ⇒ Object
Returns the value of attribute version.
8 9 10 |
# File 'lib/depengine/reporter/mail.rb', line 8 def version @version end |
#worker ⇒ Object
Returns the value of attribute worker.
9 10 11 |
# File 'lib/depengine/reporter/mail.rb', line 9 def worker @worker end |
Instance Method Details
#send(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/depengine/reporter/mail.rb', line 11 def send(={}) Helper.validates_presence_of deploy_email_from, "deploy_email_from not set" Helper.validates_presence_of deploy_email_to, "deploy_email_to not set" Helper.validates_presence_of application_name, "application_name not set" Helper.validates_presence_of module_name, "module_name not set" Helper.validates_presence_of environment, "environment not set" status = [:status] || "done" = [:message] || "" worker.sendmail(:from => "#{deploy_email_from}", \ :to => "#{deploy_email_to}", \ :subject => "JENKINS: #{module_name} #{environment} #{application_name} #{status}", \ :body => "Module: #{module_name}\nEnvironment: #{environment}\nJob: #{application_name}\nVersion: #{version}\n#{status}.\n\n#{}" ) end |