Sha256: b2b513c039bc936fb4b43811d43a132826392389bb354f87e9cd4e8d0c460a19

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require 'capistrano_mailer/version'

require 'capistrano'

unless Capistrano::Configuration.respond_to?(:instance)
  abort 'capistrano/mailer requires Capistrano 2'
end

require 'capistrano/log_with_awesome'
require 'action_mailer'

require 'cap_mailer'

module CapistranoMailer
end

module Capistrano
  class Configuration
    module CapistranoMailer
      def send_notification_email(cap, config = {}, *args)
        CapMailer.deliver_notification_email(cap, config, *args)
      end
    end

    include CapistranoMailer

    module Execution
      protected
        def __rollback_with_mailer!
          set :mailer_status, :failure
          find_and_execute_task "deploy:notify"
          __rollback_without_mailer!
        end

        alias_method :__rollback_without_mailer!, :rollback!
        alias_method :rollback!, :__rollback_with_mailer!
    end
  end
end

Capistrano.plugin :mailer, Capistrano::Configuration::CapistranoMailer

if cap = Capistrano::Configuration.instance
  cap.load("#{File.expand_path(File.dirname(__FILE__))}/mailer_recipes.rb")
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano_mailer-3.3.0 lib/capistrano/mailer.rb