Class: GroongaQueryLog::Command::RunRegressionTest::MailNotifier
- Inherits:
-
Object
- Object
- GroongaQueryLog::Command::RunRegressionTest::MailNotifier
- Defined in:
- lib/groonga-query-log/command/run-regression-test.rb
Instance Method Summary collapse
-
#initialize(success, elapsed_time, options) ⇒ MailNotifier
constructor
A new instance of MailNotifier.
- #notify ⇒ Object
Constructor Details
#initialize(success, elapsed_time, options) ⇒ MailNotifier
Returns a new instance of MailNotifier.
670 671 672 673 674 675 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 670 def initialize(success, elapsed_time, ) @success = success @elapsed_time = elapsed_time = @path = [:path] || "results" end |
Instance Method Details
#notify ⇒ Object
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 677 def notify return unless [:mail_to] output = StringIO.new formetter = FormatRegressionTestLogs.new(output: output) formetter.run([@path]) formatted_log = output.string if @success subject = [:mail_subject_on_success] else subject = [:mail_subject_on_failure] end content = format_elapsed_time content << "Report:\n" content << formatted_log send_mail(subject, content) end |