lib/cap_gun.rb in cap_gun-0.2.2 vs lib/cap_gun.rb in cap_gun-0.2.4
- old
+ new
@@ -1,5 +1,18 @@
+require 'active_support'
+
+begin
+ # This requires the full active_support.
+ # ActiveSupport v3 and up are modular and
+ # need to be explicitly loaded.
+ # Rescue in cases of ActiveSupport 2.3.2 and earlier.
+ require 'active_support/all'
+rescue
+ # Do nothing, everything should be included
+ # by default in older versions of ActiveSupport.
+end
+
require 'action_mailer'
require File.join(File.dirname(__FILE__), *%w[cap_gun presenter])
require File.join(File.dirname(__FILE__), *%w[.. vendor action_mailer_tls lib smtp_tls])
@@ -26,11 +39,11 @@
#
# cap -s comment="fix for bug #303" deploy
#
# See README for full install/config instructions.
module CapGun
- VERSION = '0.0.11'
+ VERSION = '0.2.4'
# This mailer is configured with a capistrano variable called "cap_gun_email_envelope"
class Mailer < ActionMailer::Base
def self.load_mailer_config(cap)
@@ -65,11 +78,15 @@
namespace :cap_gun do
desc "Send notification of the current release and the previous release via email."
task :email, :roles => :app do
CapGun::Mailer.load_mailer_config(self)
- CapGun::Mailer.deliver_deployment_notification(self)
+ if CapGun::Mailer.respond_to?(:deliver_deployment_notification)
+ CapGun::Mailer.deliver_deployment_notification(self)
+ else
+ CapGun::Mailer.deployment_notification(self).deliver
+ end
end
end
end
-end
\ No newline at end of file
+end