cap_gun 0.0.5 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/README.rdoc +13 -1
- data/Rakefile +2 -11
- data/cap_gun.gemspec +84 -33
- data/lib/cap_gun.rb +2 -3
- data/spec/cap_gun_spec.rb +24 -3
- data/vendor/action_mailer_tls/lib/smtp_tls.rb +7 -1
- metadata +4 -14
data/CHANGELOG
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
v0.0.9 Ruby 1.8.7 support via a small change to the Net::SMTP SSL hack
|
2
|
+
|
3
|
+
v0.0.8. Fix failing spec on runcoderun that depended on timezone; add redgreen to specs
|
4
|
+
|
5
|
+
v0.0.7. Pick up changelog and gemspec
|
6
|
+
|
7
|
+
v0.0.6. Fix subject line if there *is* a rails_env defined - this was a bug introduced with the 0.0.5 'fix'. Awesome.
|
8
|
+
|
1
9
|
v0.0.5. Fix subject line iv there is no rails_env defined
|
2
10
|
|
3
11
|
v0.0.4. Add dev dependency on echoe; update manifest
|
data/README.rdoc
CHANGED
@@ -34,6 +34,15 @@ In your Capistrano config file (usually deploy.rb):
|
|
34
34
|
|
35
35
|
# Test everything out by running "cap cap_gun:email"
|
36
36
|
|
37
|
+
== USAGE
|
38
|
+
|
39
|
+
Good news: it just works.
|
40
|
+
|
41
|
+
Want to make the notifications even better and explain _why_ you're deploying?
|
42
|
+
Just include a comment in the cap command like so, and CapGun will add the comment to the email notification.
|
43
|
+
|
44
|
+
cap -s comment="fix for bug #303" deploy
|
45
|
+
|
37
46
|
== REQUIREMENTS
|
38
47
|
|
39
48
|
* Capistrano 2+
|
@@ -81,4 +90,7 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
81
90
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
82
91
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
83
92
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
84
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
93
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
94
|
+
|
95
|
+
|
96
|
+
|
data/Rakefile
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
begin
|
2
|
-
gem 'technicalpickles-echoe'
|
3
|
-
rescue LoadError => e
|
4
|
-
puts "couldn't find the correct version of echoe - please install from forked version on github: http://github.com/technicalpickles/echoe/"
|
5
|
-
puts "gem sources -a http://gems.github.com"
|
6
|
-
puts "sudo gem install technicalpickles-echoe"
|
7
|
-
end
|
8
|
-
|
9
1
|
require 'rubygems'
|
2
|
+
gem 'echoe', '~> 3.0.1'
|
10
3
|
require 'echoe'
|
11
4
|
require './lib/cap_gun.rb'
|
12
5
|
|
@@ -23,6 +16,4 @@ echoe = Echoe.new('cap_gun') do |p|
|
|
23
16
|
p.rdoc_template = rdoc_template
|
24
17
|
p.test_pattern = 'spec/**/*_spec.rb'
|
25
18
|
p.manifest_name = 'manifest.txt'
|
26
|
-
end
|
27
|
-
|
28
|
-
echoe.spec.add_development_dependency "echoe"
|
19
|
+
end
|
data/cap_gun.gemspec
CHANGED
@@ -1,36 +1,87 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{cap_gun}
|
3
|
-
s.version = "0.0.5"
|
4
1
|
|
5
|
-
|
6
|
-
|
7
|
-
s.date = %q{2008-07-04}
|
8
|
-
s.description = %q{Super simple capistrano deployments.}
|
9
|
-
s.email = %q{opensource@thinkrelevance.com}
|
10
|
-
s.extra_rdoc_files = ["CHANGELOG", "lib/cap_gun.rb", "MIT-LICENSE", "README.rdoc"]
|
11
|
-
s.files = ["cap_gun.gemspec", "CHANGELOG", "init.rb", "install.rb", "lib/cap_gun.rb", "manifest.txt", "MIT-LICENSE", "Rakefile", "README.rdoc", "spec/cap_gun_spec.rb", "tasks/cap_bot_tasks.rake", "vendor/action_mailer_tls/init.rb", "vendor/action_mailer_tls/lib/smtp_tls.rb", "vendor/action_mailer_tls/README", "vendor/action_mailer_tls/sample/mailer.yml.sample", "vendor/action_mailer_tls/sample/smtp_gmail.rb"]
|
12
|
-
s.has_rdoc = true
|
13
|
-
s.homepage = %q{http://opensource.thinkrelevance.com/wiki/cap_gun}
|
14
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cap_gun", "--main", "README.rdoc"]
|
15
|
-
s.require_paths = ["lib"]
|
16
|
-
s.rubyforge_project = %q{thinkrelevance}
|
17
|
-
s.rubygems_version = %q{1.2.0}
|
18
|
-
s.summary = %q{Bang! You're deployed!}
|
19
|
-
s.test_files = ["spec/cap_gun_spec.rb"]
|
2
|
+
# Gem::Specification for Cap_gun-0.0.9
|
3
|
+
# Originally generated by Echoe
|
20
4
|
|
21
|
-
|
22
|
-
|
23
|
-
|
5
|
+
--- !ruby/object:Gem::Specification
|
6
|
+
name: cap_gun
|
7
|
+
version: !ruby/object:Gem::Version
|
8
|
+
version: 0.0.9
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- Rob Sanheim, Relevance
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
24
14
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
15
|
+
date: 2008-10-30 00:00:00 -04:00
|
16
|
+
default_executable:
|
17
|
+
dependencies:
|
18
|
+
- !ruby/object:Gem::Dependency
|
19
|
+
name: echoe
|
20
|
+
type: :development
|
21
|
+
version_requirement:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: "0"
|
27
|
+
version:
|
28
|
+
description: Super simple capistrano deployments.
|
29
|
+
email: opensource@thinkrelevance.com
|
30
|
+
executables: []
|
31
|
+
|
32
|
+
extensions: []
|
33
|
+
|
34
|
+
extra_rdoc_files:
|
35
|
+
- CHANGELOG
|
36
|
+
- lib/cap_gun.rb
|
37
|
+
- MIT-LICENSE
|
38
|
+
- README.rdoc
|
39
|
+
files:
|
40
|
+
- cap_gun.gemspec
|
41
|
+
- CHANGELOG
|
42
|
+
- init.rb
|
43
|
+
- install.rb
|
44
|
+
- lib/cap_gun.rb
|
45
|
+
- manifest.txt
|
46
|
+
- MIT-LICENSE
|
47
|
+
- Rakefile
|
48
|
+
- README.rdoc
|
49
|
+
- spec/cap_gun_spec.rb
|
50
|
+
- tasks/cap_bot_tasks.rake
|
51
|
+
- vendor/action_mailer_tls/init.rb
|
52
|
+
- vendor/action_mailer_tls/lib/smtp_tls.rb
|
53
|
+
- vendor/action_mailer_tls/README
|
54
|
+
- vendor/action_mailer_tls/sample/mailer.yml.sample
|
55
|
+
- vendor/action_mailer_tls/sample/smtp_gmail.rb
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://opensource.thinkrelevance.com/wiki/cap_gun
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options:
|
60
|
+
- --line-numbers
|
61
|
+
- --inline-source
|
62
|
+
- --title
|
63
|
+
- Cap_gun
|
64
|
+
- --main
|
65
|
+
- README.rdoc
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
73
|
+
version:
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "1.2"
|
79
|
+
version:
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project: thinkrelevance
|
83
|
+
rubygems_version: 1.3.0
|
84
|
+
specification_version: 2
|
85
|
+
summary: Bang! You're deployed!
|
86
|
+
test_files:
|
87
|
+
- spec/cap_gun_spec.rb
|
data/lib/cap_gun.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'active_support'
|
2
1
|
require 'action_mailer'
|
3
2
|
require File.join(File.dirname(__FILE__), *%w[.. vendor action_mailer_tls lib smtp_tls])
|
4
3
|
|
@@ -27,7 +26,7 @@ require File.join(File.dirname(__FILE__), *%w[.. vendor action_mailer_tls lib sm
|
|
27
26
|
#
|
28
27
|
# See README for full install/config instructions.
|
29
28
|
module CapGun
|
30
|
-
VERSION = '0.0.
|
29
|
+
VERSION = '0.0.9'
|
31
30
|
|
32
31
|
module Helper
|
33
32
|
|
@@ -116,7 +115,7 @@ module CapGun
|
|
116
115
|
end
|
117
116
|
|
118
117
|
def deployed_to(capistrano)
|
119
|
-
returning(
|
118
|
+
returning(deploy_msg = "deployed") { |msg| msg << " to #{capistrano[:rails_env]}" if capistrano[:rails_env] }
|
120
119
|
end
|
121
120
|
|
122
121
|
# Create the body of the message using a bunch of values from Capistrano
|
data/spec/cap_gun_spec.rb
CHANGED
@@ -4,6 +4,7 @@ require 'test/unit'
|
|
4
4
|
require 'test/spec'
|
5
5
|
require 'mocha'
|
6
6
|
require 'net/smtp'
|
7
|
+
require 'redgreen' unless Object.const_defined?("TextMate")
|
7
8
|
require File.join(File.dirname(__FILE__), *%w[.. lib cap_gun])
|
8
9
|
|
9
10
|
describe "CapGun" do
|
@@ -86,7 +87,21 @@ describe "CapGun" do
|
|
86
87
|
capistrano = { :current_release => "/data/foo", :previous_release => "/data/foo", :cap_gun_email_envelope => {:recipients => ["joe@example.com"]} }
|
87
88
|
CapGun::Mailer.any_instance.expects(:create_body).with(capistrano).returns("foo")
|
88
89
|
CapGun::Mailer.create_deployment_notification capistrano
|
90
|
+
end
|
91
|
+
|
92
|
+
it "calls Net::SMTP to send the mail correctly (we test this because SMTP internals changed between 1.8.6 and newer versions of Ruby)" do
|
93
|
+
ActionMailer::Base.smtp_settings = {
|
94
|
+
:address => "smtp.gmail.com",
|
95
|
+
:port => 587,
|
96
|
+
:domain => "foo.com",
|
97
|
+
:authentication => :plain,
|
98
|
+
:user_name => "username",
|
99
|
+
:password => "password"
|
100
|
+
}
|
89
101
|
|
102
|
+
capistrano = { :current_release => "/data/foo", :previous_release => "/data/foo", :cap_gun_email_envelope => {:recipients => ["joe@example.com"]} }
|
103
|
+
Net::SMTP.expects(:start)
|
104
|
+
CapGun::Mailer.deliver_deployment_notification capistrano
|
90
105
|
end
|
91
106
|
end
|
92
107
|
|
@@ -113,16 +128,22 @@ describe "CapGun" do
|
|
113
128
|
end
|
114
129
|
|
115
130
|
describe "creating body" do
|
131
|
+
before do # make DateTime act as if local timezone is EDT
|
132
|
+
CapGun::Mailer.any_instance.stubs(:local_timezone).returns("EDT")
|
133
|
+
CapGun::Mailer.any_instance.stubs(:local_datetime_zone_offset).returns(Rational(-1,6))
|
134
|
+
end
|
135
|
+
|
116
136
|
it "has a friendly summary line" do
|
117
137
|
CapGun::Mailer.any_instance.stubs(:current_user).returns("jdoe")
|
118
|
-
capistrano = { :application => "my app", :rails_env => "staging", :current_release => "/data/foo/releases/20080227120000",
|
138
|
+
capistrano = { :application => "my app", :rails_env => "staging", :current_release => "/data/foo/releases/20080227120000", :cap_gun_email_envelope => {} }
|
119
139
|
mail = CapGun::Mailer.create_deployment_notification capistrano
|
140
|
+
mail.subject.should == "[DEPLOY] my app deployed to staging"
|
120
141
|
mail.body.split("\n").first.should == "my app was deployed to staging by jdoe at February 27th, 2008 8:00 AM EDT."
|
121
142
|
end
|
122
143
|
|
123
|
-
it "does not include rails env
|
144
|
+
it "does not include rails env if not defined" do
|
124
145
|
CapGun::Mailer.any_instance.stubs(:current_user).returns("jdoe")
|
125
|
-
capistrano = { :application => "my app", :current_release => "/data/foo/releases/20080227120000", :cap_gun_email_envelope => {
|
146
|
+
capistrano = { :application => "my app", :current_release => "/data/foo/releases/20080227120000", :cap_gun_email_envelope => {}}
|
126
147
|
mail = CapGun::Mailer.create_deployment_notification capistrano
|
127
148
|
mail.subject.should == "[DEPLOY] my app deployed"
|
128
149
|
mail.body.split("\n").first.should == "my app was deployed by jdoe at February 27th, 2008 8:00 AM EDT."
|
@@ -5,7 +5,13 @@ Net::SMTP.class_eval do
|
|
5
5
|
private
|
6
6
|
def do_start(helodomain, user, secret, authtype)
|
7
7
|
raise IOError, 'SMTP session already started' if @started
|
8
|
-
|
8
|
+
if user or secret
|
9
|
+
if RUBY_VERSION == "1.8.7"
|
10
|
+
check_auth_args user, secret
|
11
|
+
else
|
12
|
+
check_auth_args user, secret, authtype
|
13
|
+
end
|
14
|
+
end
|
9
15
|
|
10
16
|
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
|
11
17
|
@socket = Net::InternetMessageIO.new(sock)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap_gun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Sanheim, Relevance
|
@@ -9,19 +9,9 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-30 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: echoe
|
17
|
-
type: :development
|
18
|
-
version_requirement:
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: "0"
|
24
|
-
version:
|
25
15
|
- !ruby/object:Gem::Dependency
|
26
16
|
name: echoe
|
27
17
|
type: :development
|
@@ -80,14 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
70
|
version:
|
81
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
72
|
requirements:
|
83
|
-
- - "
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: "1.2"
|
86
76
|
version:
|
87
77
|
requirements: []
|
88
78
|
|
89
79
|
rubyforge_project: thinkrelevance
|
90
|
-
rubygems_version: 1.
|
80
|
+
rubygems_version: 1.3.0
|
91
81
|
signing_key:
|
92
82
|
specification_version: 2
|
93
83
|
summary: Bang! You're deployed!
|