cap_gun 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,53 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/ */
2
+ /* v1.0 | 20080212 */
3
+
4
+ html, body, div, span, applet, object, iframe,
5
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6
+ a, abbr, acronym, address, big, cite, code,
7
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
8
+ small, strike, strong, sub, sup, tt, var,
9
+ b, u, i, center,
10
+ dl, dt, dd, ol, ul, li,
11
+ fieldset, form, label, legend,
12
+ table, caption, tbody, tfoot, thead, tr, th, td {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: 0;
16
+ outline: 0;
17
+ font-size: 100%;
18
+ vertical-align: baseline;
19
+ background: transparent;
20
+ }
21
+ body {
22
+ line-height: 1;
23
+ }
24
+ ol, ul {
25
+ list-style: none;
26
+ }
27
+ blockquote, q {
28
+ quotes: none;
29
+ }
30
+ blockquote:before, blockquote:after,
31
+ q:before, q:after {
32
+ content: '';
33
+ content: none;
34
+ }
35
+
36
+ /* remember to define focus styles! */
37
+ :focus {
38
+ outline: 0;
39
+ }
40
+
41
+ /* remember to highlight inserts somehow! */
42
+ ins {
43
+ text-decoration: none;
44
+ }
45
+ del {
46
+ text-decoration: line-through;
47
+ }
48
+
49
+ /* tables still need 'cellspacing="0"' in the markup */
50
+ table {
51
+ border-collapse: collapse;
52
+ border-spacing: 0;
53
+ }
@@ -2,40 +2,58 @@ require File.join(File.dirname(__FILE__), *%w[example_helper])
2
2
 
3
3
  describe CapGun::Presenter do
4
4
 
5
- describe "git details" do
5
+ describe "scm details" do
6
6
 
7
- it "does nothing if git is not the scm" do
8
- presenter = CapGun::Presenter.new(stub("capistrano", :scm => :svn))
9
- presenter.git_details.should == nil
7
+ it "does nothing if the scm is not git nor subversion" do
8
+ presenter = CapGun::Presenter.new(stub("capistrano", :scm => :mercurial))
9
+ presenter.scm_details.should == nil
10
10
  end
11
11
 
12
12
  it "collects branch and git log details if git is scm" do
13
13
  capistrano = {:scm => :git, :branch => "edge"}
14
14
  presenter = CapGun::Presenter.new(capistrano)
15
- presenter.expects(:git_log).returns("xxxxx")
15
+ presenter.expects(:scm_log).returns("xxxxx")
16
16
 
17
- details = presenter.git_details
17
+ details = presenter.scm_details
18
18
  details.should include("Branch: edge")
19
19
  details.should include("xxxxx")
20
20
  end
21
21
  end
22
22
 
23
- describe "git log messages" do
23
+ describe "scm log messages" do
24
+ describe "with git" do
25
+ it "returns N/A if the git log call returns an error" do
26
+ capistrano = {:scm => :git, :previous_revision => "previous-sha", :current_revision => "current-sha" }
27
+ presenter = CapGun::Presenter.new(capistrano)
28
+ presenter.stubs(:`).returns("fatal: Not a git repo")
29
+ presenter.stubs(:exit_code).returns(stub("process status", :success? => false))
30
+ presenter.scm_log_messages.should == "N/A"
31
+ end
24
32
 
25
- it "returns N/A if the git log call returns an error" do
26
- capistrano = { :previous_revision => "previous-sha", :current_revision => "current-sha" }
27
- presenter = CapGun::Presenter.new(capistrano)
28
- presenter.stubs(:`).returns("fatal: Not a git repo")
29
- presenter.stubs(:exit_code).returns(stub("process status", :success? => false))
30
- presenter.git_log_messages.should == "N/A"
33
+ it "calls git log with previous_rev..current_rev" do
34
+ capistrano = {:scm => :git, :previous_revision => "previous-sha", :current_revision => "current-sha" }
35
+ presenter = CapGun::Presenter.new(capistrano)
36
+ presenter.stubs(:exit_code).returns(stub("process status", :success? => true))
37
+ presenter.expects(:`).with(includes("git log previous-sha..current-sha"))
38
+ presenter.scm_log_messages
39
+ end
31
40
  end
32
-
33
- it "calls git log with previous_rev..current_rev" do
34
- capistrano = { :previous_revision => "previous-sha", :current_revision => "current-sha" }
35
- presenter = CapGun::Presenter.new(capistrano)
36
- presenter.stubs(:exit_code).returns(stub("process status", :success? => true))
37
- presenter.expects(:`).with(includes("git log previous-sha..current-sha"))
38
- presenter.git_log_messages
41
+ describe "with subversion" do
42
+ it "returns N/A if the svn log call returns an error" do
43
+ capistrano = {:scm => :subversion, :previous_revision => "42", :current_revision => "46" }
44
+ presenter = CapGun::Presenter.new(capistrano)
45
+ presenter.stubs(:`).returns("fatal: Not a working copy")
46
+ presenter.stubs(:exit_code).returns(stub("process status", :success? => false))
47
+ presenter.scm_log_messages.should == "N/A"
48
+ end
49
+
50
+ it "calls svn log with -r previous_rev+1:current_rev" do
51
+ capistrano = {:scm => :subversion, :previous_revision => "42", :current_revision => "46" }
52
+ presenter = CapGun::Presenter.new(capistrano)
53
+ presenter.stubs(:exit_code).returns(stub("process status", :success? => true))
54
+ presenter.expects(:`).with(includes("svn log -r 43:46"))
55
+ presenter.scm_log_messages
56
+ end
39
57
  end
40
58
  end
41
59
 
Binary file
@@ -0,0 +1,81 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>LICENSE</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
10
+ <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ LICENSE
19
+ </h1>
20
+ <ul class="files">
21
+ <li>LICENSE</li>
22
+ <li>Last modified: Wed Oct 14 16:24:15 -0400 2009</li>
23
+ </ul>
24
+ </div>
25
+
26
+ <div id="bodyContent">
27
+ <div id="content">
28
+
29
+ <div class="description">
30
+ <p>
31
+ Copyright &#169; 2009 Relevance, Inc.
32
+ </p>
33
+ <p>
34
+ Permission is hereby granted, free of charge, to any person obtaining a
35
+ copy of this software and associated documentation files (the
36
+ &#8220;Software&#8221;), to deal in the Software without restriction,
37
+ including without limitation the rights to use, copy, modify, merge,
38
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
39
+ permit persons to whom the Software is furnished to do so, subject to the
40
+ following conditions:
41
+ </p>
42
+ <p>
43
+ The above copyright notice and this permission notice shall be included in
44
+ all copies or substantial portions of the Software.
45
+ </p>
46
+ <p>
47
+ THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND,
48
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
50
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
51
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
52
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
53
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
54
+ </p>
55
+
56
+ </div>
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ </div>
79
+ </div>
80
+ </body>
81
+ </html>
@@ -0,0 +1,171 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>README.markdown</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
10
+ <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ README.markdown
19
+ </h1>
20
+ <ul class="files">
21
+ <li>README.markdown</li>
22
+ <li>Last modified: Wed Oct 14 16:29:21 -0400 2009</li>
23
+ </ul>
24
+ </div>
25
+
26
+ <div id="bodyContent">
27
+ <div id="content">
28
+
29
+ <div class="description">
30
+ <h1>CapGun</h1>
31
+
32
+ <h2>DESCRIPTION</h2>
33
+
34
+ <p>Tell everyone about your releases! Send email notification after Capistrano deployments! Rule the world!</p>
35
+
36
+ <p>Drop your ActionMailer configuration information into your deploy.rb file, configure recipients for the deployment notifications, and setup the callback task.</p>
37
+
38
+ <p>Setup and configuration are done entirely inside your deploy.rb file to keep it super simple. Your emails are sent locally from the box performing the deployment, but CapGun queries the server to grab the necessary release info.</p>
39
+
40
+ <p>This even includes the Net::SMTP TLS hack inside as a vendored dependancy to allow super easy email sending without setting up an MTA.</p>
41
+
42
+ <h2>CONFIG</h2>
43
+
44
+ <p>In your Capistrano config file (usually deploy.rb):</p>
45
+
46
+ <pre><code># require cap_gun (the path will depend on where you unpacked or if you are just using it as a gem)
47
+ require 'vendor/plugins/cap_gun/lib/cap_gun' # typical Rails vendor/plugins location
48
+
49
+ # setup action mailer with a hash of options
50
+ set :cap_gun_action_mailer_config, {
51
+ :address =&gt; "smtp.gmail.com",
52
+ :port =&gt; 587,
53
+ :user_name =&gt; "[YOUR_USERNAME]@gmail.com",
54
+ :password =&gt; "[YOUR_PASSWORD]",
55
+ :authentication =&gt; :plain
56
+ }
57
+
58
+ # define the options for the actual emails that go out -- :recipients is the only required option
59
+ set :cap_gun_email_envelope, {
60
+ :from =&gt; "project.deployer@example.com", # Note, don't use the form "Someone project.deploy@example.com" as it'll blow up with ActionMailer 2.3+
61
+ :recipients =&gt; %w[joe@example.com, jane@example.com]
62
+ }
63
+
64
+ # register email as a callback after restart
65
+ after "deploy:restart", "cap_gun:email"
66
+
67
+ # Test everything out by running "cap cap_gun:email"
68
+ </code></pre>
69
+
70
+ <h2>USAGE</h2>
71
+
72
+ <p>Good news: it just works.<br/>
73
+ </p>
74
+
75
+ <p>By default CapGun includes info like the user who is deploying and what server its being deployed to. CapGun is biased for git (patches accepted for other SCMs), so it will include details like your current branch, the revisions since last deployment, the current commit being deployed.</p>
76
+
77
+ <p>Want to make the notifications even better and explain <em>why</em> you're deploying?
78
+ Just include a comment in the cap command like so, and CapGun will add the comment to the email notification.</p>
79
+
80
+ <pre><code>cap -s comment="fix for bug #303" deploy
81
+ </code></pre>
82
+
83
+ <h2>REQUIREMENTS</h2>
84
+
85
+ <ul>
86
+ <li>Capistrano 2+</li>
87
+ <li>A Gmail account to send from, or an MTA (mail transport agent) installed locally to send from</li>
88
+ <li>Something to deploy</li>
89
+ </ul>
90
+
91
+
92
+ <h2>TODO &amp; KNOWN ISSUES</h2>
93
+
94
+ <ul>
95
+ <li>displays the release times in UTC (Capistrano default) - could be flipped to specified time zone</li>
96
+ <li>some stuff will probably break on windows - patches welcome</li>
97
+ </ul>
98
+
99
+
100
+ <h2>INSTALL</h2>
101
+
102
+ <ul>
103
+ <li><code>sudo gem install cap_gun</code> and gem unpack into your vendor/plugins</li>
104
+ <li>or just grab the tarball from github (see below)</li>
105
+ </ul>
106
+
107
+
108
+ <h2>URLS</h2>
109
+
110
+ <ul>
111
+ <li>Log bugs, issues, and suggestions at GitHub: http://github.com/relevance/cap_gun/issues</li>
112
+ <li>View source: http://github.com/relevance/cap_gun</li>
113
+ <li>Continuos Integration: http://runcoderun.com/relevance/cap_gun</li>
114
+ <li>SDocs: http://relevance.github.com/cap_gun/</li>
115
+ </ul>
116
+
117
+
118
+ <p>== LICENSE</p>
119
+
120
+ <p>(The MIT License)</p>
121
+
122
+ <p>Copyright (c) 2009 Relevance, Inc. - http://thinkrelevance.com</p>
123
+
124
+ <p>Permission is hereby granted, free of charge, to any person obtaining
125
+ a copy of this software and associated documentation files (the
126
+ 'Software'), to deal in the Software without restriction, including
127
+ without limitation the rights to use, copy, modify, merge, publish,
128
+ distribute, sublicense, and/or sell copies of the Software, and to
129
+ permit persons to whom the Software is furnished to do so, subject to
130
+ the following conditions:</p>
131
+
132
+ <p>The above copyright notice and this permission notice shall be
133
+ included in all copies or substantial portions of the Software.</p>
134
+
135
+ <p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
136
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
137
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
138
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
139
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
140
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
141
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
142
+ <script type="text/javascript">$(function() {
143
+ $('a').each(function() { $(this).attr('target', '_blank') })
144
+ })</script>
145
+
146
+ </div>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ </div>
169
+ </div>
170
+ </body>
171
+ </html>
@@ -0,0 +1,66 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>presenter.rb</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
10
+ <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ presenter.rb
19
+ </h1>
20
+ <ul class="files">
21
+ <li>lib/cap_gun/presenter.rb</li>
22
+ <li>Last modified: Fri Oct 09 09:37:26 -0400 2009</li>
23
+ </ul>
24
+ </div>
25
+
26
+ <div id="bodyContent">
27
+ <div id="content">
28
+
29
+
30
+
31
+ <div class="sectiontitle">Required Files</div>
32
+ <ul>
33
+
34
+ <li>etc</li>
35
+
36
+ </ul>
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+ <div class="sectiontitle">Classes and Modules</div>
51
+ <ul>
52
+
53
+ <li><span class="type">MODULE</span> <a href="../../../classes/CapGun.html">CapGun</a></li>
54
+
55
+ </ul>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ </div>
64
+ </div>
65
+ </body>
66
+ </html>