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.



942
943
944
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 942

def initialize(options)
  @options = options
end

Instance Method Details

#notify_finished(success, report) ⇒ Object



954
955
956
957
958
959
960
961
962
963
964
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 954

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



946
947
948
949
950
951
952
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 946

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