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.
656 657 658 659 660 661 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 656 def initialize(success, elapsed_time, ) @success = success @elapsed_time = elapsed_time @options = @path = @options[:path] || "results" end |
Instance Method Details
#notify ⇒ Object
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 663 def notify return unless @options[:mail_to] output = StringIO.new formetter = FormatRegressionTestLogs.new(output: output) formetter.run([@path]) formatted_log = output.string if @success subject = @options[:mail_subject_on_success] else subject = @options[:mail_subject_on_failure] end content = format_elapsed_time content << "Report:\n" content << formatted_log send_mail(subject, content) end |