Sha256: 591c9b052270066fc945624903eb4a26cec1410f7a83a9198cbbc6d5b61bb46e

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 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_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.4.3 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.4.2 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.4.1 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.4.0 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.3.4 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.3.3 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.3.2 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.3.1 lib/autoload/kuroko2/workflow/notifier/mail.rb
kuroko2-0.3.0 lib/autoload/kuroko2/workflow/notifier/mail.rb