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.



956
957
958
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 956

def initialize(options)
  @options = options
end

Instance Method Details

#notify_finished(success, report) ⇒ Object



968
969
970
971
972
973
974
975
976
977
978
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 968

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



960
961
962
963
964
965
966
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 960

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