capistrano_mailer 3.3.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,45 +1,25 @@
1
- require 'capistrano_mailer/version'
2
-
3
- require 'capistrano'
1
+ require 'rubygems' unless defined?(Rubygems)
2
+ require 'capistrano' unless defined?(Capistrano)
4
3
 
5
4
  unless Capistrano::Configuration.respond_to?(:instance)
6
- abort 'capistrano/mailer requires Capistrano 2'
5
+ abort "capistrano/mailer requires Capistrano 2"
7
6
  end
8
7
 
9
- require 'capistrano/log_with_awesome'
10
- require 'action_mailer'
8
+ require 'action_mailer' unless defined?(ActionMailer)
11
9
 
12
- require 'cap_mailer'
10
+ require 'cap_mailer' unless defined?(CapMailer)
13
11
 
14
- module CapistranoMailer
15
- end
16
12
 
17
13
  module Capistrano
18
14
  class Configuration
19
15
  module CapistranoMailer
20
16
  def send_notification_email(cap, config = {}, *args)
21
- CapMailer.deliver_notification_email(cap, config, *args)
17
+ CapMailer.notification_email(cap, config, *args).deliver
22
18
  end
23
19
  end
24
20
 
25
21
  include CapistranoMailer
26
-
27
- module Execution
28
- protected
29
- def __rollback_with_mailer!
30
- set :mailer_status, :failure
31
- find_and_execute_task "deploy:notify"
32
- __rollback_without_mailer!
33
- end
34
-
35
- alias_method :__rollback_without_mailer!, :rollback!
36
- alias_method :rollback!, :__rollback_with_mailer!
37
- end
38
22
  end
39
23
  end
40
24
 
41
25
  Capistrano.plugin :mailer, Capistrano::Configuration::CapistranoMailer
42
-
43
- if cap = Capistrano::Configuration.instance
44
- cap.load("#{File.expand_path(File.dirname(__FILE__))}/mailer_recipes.rb")
45
- end
@@ -21,11 +21,11 @@
21
21
  <% if key.is_a?(Symbol) && !data[key].nil?-%>
22
22
  <p style="margin: 10px; padding: 0px;">
23
23
  <span style="float:left; width:150px; padding: 10px 10px 0;"><%= key.to_s.titleize %></span>
24
- <span style="float:left; width:490px; padding: 10px 10px 0;"><%= data[key].is_a?(Array) ? data[key].to_sentence : data[key].is_a?(String) ? data[key] : data[key].inspect %></span>
24
+ <span style="float:left; width:490px; padding: 10px 10px 0;"><%= data[key].is_a?(Array) ? data[key].to_sentence : data[key].is_a?(String) ? data[key].gsub(/\n/, '<br>').gsub(/\n/, '<br>').html_safe : data[key].inspect.html_safe %></span>
25
25
  </p>
26
26
  <% end -%>
27
27
  <% end -%>
28
28
  <% end -%>
29
29
  <p style="clear:both"></p>
30
-
30
+
31
31
  </div>
@@ -7,10 +7,9 @@
7
7
  <p style="margin: 10px; padding: 0px;">
8
8
  <span style="float:left; width:150px; padding: 10px 10px 0;"><%= key %></span>
9
9
  <span style="float:left; width:490px; padding: 10px 10px 0;"><%= value.is_a?(Array) ? value.to_sentence : value.is_a?(String) ? value : value.inspect%></span>
10
- <span style="clear: both;"></span>
11
10
  </p>
12
11
  <% end -%>
13
12
  <% end unless data.nil?-%>
14
13
  <p style="clear:both"></p>
15
-
14
+
16
15
  </div>
@@ -1 +1,39 @@
1
- <%= render "message_body" %>
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <title><%= @site_name %> Notification </title>
6
+ </head>
7
+ <body style="font: 14px normal Helvetica, Arial, Sans; background: #999;">
8
+
9
+ <div style="width:800px; margin: 10px auto; background: #fff; border: 10px solid #aaa;">
10
+
11
+ <h1 style="clear: both; margin: 0; padding: 40px 20px 5px 20px; border-bottom: 1px dotted; background: #ccc;">
12
+ <%= @site_name %> <%=@task_name.titleize unless @task_name.nil? %>
13
+ </h1>
14
+
15
+ <% unless @site_url.nil? %>
16
+ <p style="margin: 8px 0 20px 20px; padding: 0px; font-style: italic;" >
17
+ View site: <a href="<%= @site_url.html_safe -%>"><%= @site_url.html_safe -%></a>
18
+ </p>
19
+ <% end %>
20
+
21
+ <p style="margin: 10px 20px; font-weight: bold;">Released: <%= @date %> at <%= @time %></p>
22
+
23
+ <%= @sections.map { |section|
24
+ data = @section_data[section.to_sym]
25
+ if !data.empty?
26
+ if %w(extra_information release_data).include?(section)
27
+ render :partial => 'section_custom.html.erb', :locals => {:section_title => section, :data => data}
28
+ else
29
+ render :partial => 'section.html.erb', :locals => {:section_title => section, :data => data}
30
+ end
31
+ end
32
+ }.join.html_safe unless @sections.nil? %>
33
+ </div>
34
+
35
+ <p style="margin: 8px 0 20px 20px; padding: 0px; font-style: italic;" >
36
+ Brought to you by: <a href="http://github.com/textgoeshere/capistrano_mailer">Capistrano Mailer</a>
37
+ </p>
38
+ </body>
39
+ </html>
@@ -0,0 +1,22 @@
1
+ <%= @site_name %> Notification
2
+ ===========================================================
3
+
4
+ <%= @site_name %> <%=@task_name.titleize unless @task_name.nil? %>
5
+ ===========================================================
6
+ Brought to you by: Capistrano Mailer - http://github.com/pboling/capistrano_mailer
7
+ Released: <%= @date %> at <%= @time %>
8
+
9
+ <%= @sections.map { |section|
10
+ data = @section_data[section.to_sym]
11
+ if !data.empty?
12
+ if %w(extra_information release_data).include?(section)
13
+ render :partial => 'section_custom.text.erb', :locals => {:section_title => section, :data => data}
14
+ else
15
+ render :partial => 'section.text.erb', :locals => {:section_title => section, :data => data}
16
+ end
17
+ end
18
+ }.join.html_safe unless @sections.nil? %>
19
+
20
+ ===========================================================
21
+ Copyright 2009 9thBit LLC under MIT License
22
+ Copyright 2007-8 Sagebit LLC under MIT License
metadata CHANGED
@@ -1,136 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capistrano_mailer
3
- version: !ruby/object:Gem::Version
4
- hash: 11
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.0.0
5
5
  prerelease:
6
- segments:
7
- - 3
8
- - 3
9
- - 0
10
- version: 3.3.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Peter Boling
14
9
  - Dave Nolan
10
+ - Jason Rust
15
11
  autorequire:
16
12
  bindir: bin
17
13
  cert_chain: []
18
-
19
- date: 2014-03-21 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: capistrano-log_with_awesome
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
33
- type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
14
+ date: 2011-12-11 00:00:00.000000000Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
36
17
  name: actionmailer
37
- prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
18
+ requirement: &70339020048080 !ruby/object:Gem::Requirement
39
19
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
47
- - - <
48
- - !ruby/object:Gem::Version
49
- hash: 5
50
- segments:
51
- - 3
52
- version: "3"
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
53
24
  type: :runtime
54
- version_requirements: *id002
55
- description: Capistrano Deployment Email Notification. Keep the whole team informed of each release! (Rails 2.X version)
56
- email:
25
+ prerelease: false
26
+ version_requirements: *70339020048080
27
+ description: Capistrano Deployment Email Notification. Keep the whole team informed
28
+ of each release!
29
+ email:
57
30
  - peter.boling@gmail.com
58
31
  - dave@textgoeshere.org.uk
32
+ - jason@rustedcode.com
59
33
  executables: []
60
-
61
34
  extensions: []
62
-
63
- extra_rdoc_files:
64
- - CHANGELOG.md
65
- - LICENSE.txt
66
- - README.md
67
- files:
35
+ extra_rdoc_files:
36
+ - README.rdoc
37
+ files:
38
+ - MIT-LICENSE
39
+ - README.rdoc
40
+ - Rakefile
41
+ - VERSION.yml
42
+ - capistrano_mailer.gemspec
68
43
  - lib/cap_mailer.rb
69
44
  - lib/capistrano/mailer.rb
70
- - lib/capistrano/mailer_recipes.rb
71
- - lib/capistrano_mailer/version.rb
72
- - lib/capistrano_mailer.rb
73
- - test/build_gem_test.rb
74
- - spec/create_gemset_spec.rb
75
- - spec/empty_gemset_spec.rb
76
- - spec/install_ruby_spec.rb
77
- - spec/rvm_paths_spec.rb
78
- - spec/spec_helper.rb
79
- - spec/support/abort_matcher.rb
80
- - spec/support/capistrano.rb
81
- - views/cap_mailer/_message_body.html.erb
82
- - views/cap_mailer/_message_body.text.erb
83
45
  - views/cap_mailer/_section.html.erb
84
46
  - views/cap_mailer/_section.text.erb
85
47
  - views/cap_mailer/_section_custom.html.erb
86
48
  - views/cap_mailer/_section_custom.text.erb
87
- - views/cap_mailer/failed.notification_email.html.erb
88
- - views/cap_mailer/failed.notification_email.plain.erb
89
49
  - views/cap_mailer/notification_email.html.erb
90
- - views/cap_mailer/notification_email.plain.erb
91
- - LICENSE.txt
92
- - README.md
93
- - CHANGELOG.md
94
- - Rakefile
50
+ - views/cap_mailer/notification_email.text.erb
95
51
  homepage: http://github.com/pboling/capistrano_mailer
96
52
  licenses: []
97
-
98
53
  post_install_message:
99
54
  rdoc_options: []
100
-
101
- require_paths:
55
+ require_paths:
102
56
  - lib
103
- required_ruby_version: !ruby/object:Gem::Requirement
57
+ required_ruby_version: !ruby/object:Gem::Requirement
104
58
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- hash: 3
109
- segments:
110
- - 0
111
- version: "0"
112
- required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
64
  none: false
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- hash: 3
118
- segments:
119
- - 0
120
- version: "0"
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
121
69
  requirements: []
122
-
123
70
  rubyforge_project:
124
- rubygems_version: 1.8.29
71
+ rubygems_version: 1.8.10
125
72
  signing_key:
126
73
  specification_version: 3
127
74
  summary: Capistrano Deployment Email Notification
128
- test_files:
129
- - test/build_gem_test.rb
130
- - spec/create_gemset_spec.rb
131
- - spec/empty_gemset_spec.rb
132
- - spec/install_ruby_spec.rb
133
- - spec/rvm_paths_spec.rb
134
- - spec/spec_helper.rb
135
- - spec/support/abort_matcher.rb
136
- - spec/support/capistrano.rb
75
+ test_files: []
@@ -1,116 +0,0 @@
1
- ## Next...
2
- * Add tests with rspec and capistrano-spec
3
-
4
- ## Version 3.3.0 2014-03-17
5
- * Fix compatibility with Rails 2.3.18
6
- * Integrate Travis-ci
7
- * Integrate Coveralls
8
- * Backport (most) new features from master (4.X releases)
9
- * Gemfile.lock should not be in version control for a gem by Peter Boling
10
- * Do not require RubyGems by Peter Boling
11
- * Fix dependency declarations; remove jeweler dependency; improve gemspec by Peter Boling
12
- * Modernize the ruby manager by Peter Boling
13
- * Modernize the VERSION by Peter Boling
14
- * Markdown the Readme. by Peter Boling (pboling)
15
- * Modern the License by Peter Boling (pboling)
16
- * Markdown the Changelog by Peter Boling (pboling)
17
- * Git Release Notes by Mark Sim (marksim)
18
- * Improved Readme by Peter Boling (pboling)
19
-
20
- ## Version 3.2.7 2011-12-11
21
- * General file cleanup
22
- * Improved Readme
23
- * Fix to \*args passing to CapMailer.deliver_notification_email (dreamnid)
24
-
25
- ## Version 3.2.6 --botched--
26
-
27
- ## Version 3.2.5 2010-04-29
28
- * Remove Active Support dependency
29
-
30
- ## Version 3.2.4 2010-01-13
31
- * Fixed subject line format (mail client filters are based on format of subject line)
32
-
33
- ## Version 3.2.3 2010-01-13
34
- * config[:user] is now optional.
35
-
36
- ## Version 3.2.2 2010-01-13
37
- * Improved Readme
38
-
39
- ## Version 3.2.1 2010-01-13
40
- * Added deprecation warning for configure_capistrano_mailer
41
- * commented :site_url, doesn't appear to be a native capistrano variable, if sent in will still be rendered.
42
-
43
- ## Version 3.2.0 textgoeshere fork
44
- * config/cap_mailer_settings.rb is not longer a hard coded configuration location requirement.
45
- * refactoring core cap mailer class
46
-
47
- ## Version 3.1.10 2010-01-07
48
- * included \_section.text.erb view in gem manifest
49
- * text version of email should render the text partials, not html
50
-
51
- ## Version 3.1.9 2010-01-07
52
- * Fixed URL for capistrano_mailer repo on github in HTML email message
53
-
54
- ## Version 3.1.8 2010-01-07
55
- * Improved Readme
56
-
57
- ## Version 3.1.6 2009-11-10
58
- * Fixed installation instructions to reference gemcutter instead of github
59
-
60
- ## Version 3.1.3 2009-09-29
61
- * Added Git as known compatable SCM to readme
62
- * Credited Dustin Deyoung as Author of HTML Email templates
63
- * Removed MIT-LICENSE file from gemspec (because github refuses to build with it there)
64
- * Still trying to get github to build the gem
65
-
66
- ## Version 3.1.2 2009-09-25
67
- * Fixed footer copyright
68
- * Trying to get github to build the gem
69
-
70
- ## Version 3.1.1 2009-09-24
71
- * Added back compatability with svn which broke when fixing for perforce (thanks to Matthew Beale / mixonic)
72
- * Improved Readme for plugin installation. Tested as a plugin. Verified continued compatibility with Deprec.
73
-
74
- ## Version 3.1.0 2009-09-17
75
- * Added compatability with perforce (thanks to Andy Kock / ak47)
76
-
77
- ## Version 3.0.3 2009-09-03
78
- * Improved readme and upgrade instructions
79
-
80
- ## Version 3.0.2 2009-08-27
81
- * Fixed some typos in readme referencing outdated API
82
-
83
- ## Version 3.0.1 2009-08-21
84
- * removed a stray puts used in debugging
85
-
86
- ## Version 3.0.0 2009-08-19
87
- * turned into a gem
88
- * New API for configuration
89
- * improved email templates (hardened against crappy data)
90
- * added simple testing framwork and Rakefile
91
- * still compatible with deprec
92
-
93
- ## Version 2.1.0 2008-11-15
94
- * improved readme, and other stuff I don't remember
95
-
96
- ## Version 2.0.1 2008-07-30
97
- * Works when deploying to a server without capistrano installed
98
- * Updated README and WIKI (improved documentation)
99
-
100
- ## Version 2.0 2008-07-25
101
- * Works with Rails 2.1
102
- * Works with Capistrano 2.4.3
103
- * Added access to many of Capistrano's internal variables (~25) so the emails can be more informative
104
- * Added inferred_command, repo_end and some other derived variables that give more insight into a deployment
105
- * Parameters are now sent in a hash
106
- * Emails updated with new information
107
- * HTML email improved layout, and added styling (thanks to Dustin Deyoung @ Sagebit)
108
-
109
- ## Version 1.0.1 2008-03-26
110
- * Works with Rails 2.0.2
111
- * Works with Capistrano 2.1.0 - 2.2.0
112
- * Compatability with Deprec verified
113
-
114
- ## Version 1.0 2008-02-11
115
- * Works with Rails 2.0.2
116
- * Works with Capistrano 2.1.0
@@ -1,23 +0,0 @@
1
- Copyright (c) 2008-2014 Peter H. Boling (http://railsbling.com)
2
- Copyright (c) 2007-8 Sagebit, LLC
3
-
4
- MIT License
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining
7
- a copy of this software and associated documentation files (the
8
- "Software"), to deal in the Software without restriction, including
9
- without limitation the rights to use, copy, modify, merge, publish,
10
- distribute, sublicense, and/or sell copies of the Software, and to
11
- permit persons to whom the Software is furnished to do so, subject to
12
- the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.