Skip to content

Commit

Permalink
* Remove rails 3 deprecation warnings
Browse files Browse the repository at this point in the history
* Remove release_notes as it doesn't appear to be a cap variable
  • Loading branch information
Jason Rust committed Dec 7, 2011
1 parent f23bb80 commit fc37bcc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 71 deletions.
1 change: 0 additions & 1 deletion README.rdoc
Expand Up @@ -134,7 +134,6 @@ From version 2.1.0 to version 3.1.x:
config[:sender_address] = "deployment@example.com"
config[:subject_prepend] = "[EMPTY-CAP-DEPLOY]"
config[:site_name] = "Empty Example.com App"
config[:email_content_type] = "text/html" # OR "text/plain" if you want the plain text version of the email
end

4. Add these two tasks to your deploy.rb:
Expand Down
18 changes: 10 additions & 8 deletions lib/cap_mailer.rb
Expand Up @@ -25,7 +25,7 @@ def self.configure_capistrano_mailer(&block)
puts "Deprecated 'configure_capistrano_mailer'. Please update your capistrano_mailer configuration to use 'configure' instead of 'configure_capistrano_mailer'"
end

self.template_root = default_base_config[:template_root]
self.prepend_view_path default_base_config[:template_root]

def self.reloadable?() false end

Expand All @@ -43,7 +43,8 @@ def notification_email(cap, config = {}, *args)
:revision => cap.revision,
:real_revision => cap.real_revision,
:release_name => cap.release_name,
:release_notes => cap.release_notes,
#This does not appear to be a capistrano variable:
#:release_notes => cap.release_notes,
:version_dir => cap.version_dir,
:shared_dir => cap.shared_dir,
:current_dir => cap.current_dir,
Expand Down Expand Up @@ -78,13 +79,14 @@ def notification_email(cap, config = {}, *args)
front = front.slice(0..x)
end
@repo_end = repo.sub(front, '')

subject subject_line
recipients @config[:recipient_addresses]
from @config[:sender_address]
content_type @config[:email_content_type]

body body_data_hash
body_data_hash.each_pair do |k, v|
self.instance_variable_set("@#{k}", v)
end

mail :subject => subject_line,
:to => @config[:recipient_addresses],
:from => @config[:sender_address]
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/mailer.rb
Expand Up @@ -14,7 +14,7 @@ module Capistrano
class Configuration
module CapistranoMailer
def send_notification_email(cap, config = {}, *args)
CapMailer.deliver_notification_email(cap, config, *args)
CapMailer.notification_email(cap, config, *args).deliver
end
end

Expand Down
39 changes: 0 additions & 39 deletions views/cap_mailer/notification_email.text.html.erb

This file was deleted.

22 changes: 0 additions & 22 deletions views/cap_mailer/notification_email.text.plain.erb

This file was deleted.

0 comments on commit fc37bcc

Please sign in to comment.