Class: GroongaQueryLog::Command::RunRegressionTest::MailNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga-query-log/command/run-regression-test.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ MailNotifier

Returns a new instance of MailNotifier.



916
917
918
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 916

def initialize(options)
  @options = options
end

Instance Method Details

#notify_finished(success, report) ⇒ Object



928
929
930
931
932
933
934
935
936
937
938
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 928

def notify_finished(success, report)
  return unless @options[:mail_to]

  if success
    subject = @options[:mail_subject_on_success]
    return if @options[:mail_only_on_failure]
  else
    subject = @options[:mail_subject_on_failure]
  end
  send_mail(subject, report)
end

#notify_startedObject



920
921
922
923
924
925
926
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 920

def notify_started
  return unless @options[:mail_to]
  return if @options[:mail_only_on_failure]

  subject = @options[:mail_subject_on_start]
  send_mail(subject, "")
end