Sha256: a2a8d9e8a14831e21597a37e52b926db18ca47c6df2d4f30129d766672de0b58

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

module Kuroko2
  module Workflow
    module Notifier
      class Mail
        def initialize(job_instance)
          @job_instance = job_instance
          @definition   = job_instance.job_definition
        end

        def notify_launch
          # do nothing
        end

        def notify_retrying
          # do nothing
        end

        def notify_skipping
          # do nothing
        end

        def notify_cancellation
          if @definition.notify_cancellation
            deliver_job_failure
          end
        end

        def notify_failure
          deliver_job_failure
        end

        def notify_critical
          deliver_job_failure
        end

        def notify_finished
          # do nothing
        end

        def notify_back_to_normal
          # do nothing
        end

        def notify_long_elapsed_time
          Kuroko2::Notifications.notify_long_elapsed_time(@job_instance).deliver_now
        end

        private

        def deliver_job_failure
          Kuroko2::Notifications.job_failure(@job_instance).deliver_now
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kuroko2-0.8.0 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.7.0 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.6.0 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.5.2 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.5.1 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.5.0 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.4.6 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.4.5 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.4.4 lib/autoload/kuroko2/workflow/notifier/mail.rb