relevance-cap_gun 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.0.5. Fix subject line iv there is no rails_env defined
2
+
1
3
  v0.0.4. Add dev dependency on echoe; update manifest
2
4
 
3
5
  v0.0.3. Don't try to convert the RAILS_ENV if its not set to better support default capistrano deployments
data/Rakefile CHANGED
@@ -1,3 +1,11 @@
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
+
1
9
  require 'rubygems'
2
10
  require 'echoe'
3
11
  require './lib/cap_gun.rb'
data/cap_gun.gemspec CHANGED
@@ -1,97 +1,36 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{cap_gun}
3
+ s.version = "0.0.5"
1
4
 
2
- # Gem::Specification for Cap_gun-0.0.4
3
- # Originally generated by Echoe
5
+ s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Rob Sanheim, Relevance"]
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"]
4
20
 
5
- --- !ruby/object:Gem::Specification
6
- name: cap_gun
7
- version: !ruby/object:Gem::Version
8
- version: 0.0.4
9
- platform: ruby
10
- authors:
11
- - Rob Sanheim, Relevance
12
- autorequire:
13
- bindir: bin
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 2
14
24
 
15
- date: 2008-06-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
- - !ruby/object:Gem::Dependency
29
- name: echoe
30
- type: :development
31
- version_requirement:
32
- version_requirements: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: "0"
37
- version:
38
- description: Super simple capistrano deployments.
39
- email: opensource@thinkrelevance.com
40
- executables: []
41
-
42
- extensions: []
43
-
44
- extra_rdoc_files:
45
- - CHANGELOG
46
- - lib/cap_gun.rb
47
- - MIT-LICENSE
48
- - README.rdoc
49
- files:
50
- - cap_gun.gemspec
51
- - CHANGELOG
52
- - init.rb
53
- - install.rb
54
- - lib/cap_gun.rb
55
- - manifest.txt
56
- - MIT-LICENSE
57
- - Rakefile
58
- - README.rdoc
59
- - spec/cap_gun_spec.rb
60
- - tasks/cap_bot_tasks.rake
61
- - vendor/action_mailer_tls/init.rb
62
- - vendor/action_mailer_tls/lib/smtp_tls.rb
63
- - vendor/action_mailer_tls/README
64
- - vendor/action_mailer_tls/sample/mailer.yml.sample
65
- - vendor/action_mailer_tls/sample/smtp_gmail.rb
66
- has_rdoc: true
67
- homepage: http://opensource.thinkrelevance.com/wiki/cap_gun
68
- post_install_message:
69
- rdoc_options:
70
- - --line-numbers
71
- - --inline-source
72
- - --title
73
- - Cap_gun
74
- - --main
75
- - README.rdoc
76
- require_paths:
77
- - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: "0"
83
- version:
84
- required_rubygems_version: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "="
87
- - !ruby/object:Gem::Version
88
- version: "1.2"
89
- version:
90
- requirements: []
91
-
92
- rubyforge_project: thinkrelevance
93
- rubygems_version: 1.2.0
94
- specification_version: 2
95
- summary: Bang! You're deployed!
96
- test_files:
97
- - spec/cap_gun_spec.rb
25
+ if current_version >= 3 then
26
+ s.add_development_dependency(%q<echoe>, [">= 0"])
27
+ s.add_development_dependency(%q<echoe>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<echoe>, [">= 0"])
30
+ s.add_dependency(%q<echoe>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<echoe>, [">= 0"])
34
+ s.add_dependency(%q<echoe>, [">= 0"])
35
+ end
36
+ end
data/lib/cap_gun.rb CHANGED
@@ -27,7 +27,7 @@ require File.join(File.dirname(__FILE__), *%w[.. vendor action_mailer_tls lib sm
27
27
  #
28
28
  # See README for full install/config instructions.
29
29
  module CapGun
30
- VERSION = '0.0.4'
30
+ VERSION = '0.0.5'
31
31
 
32
32
  module Helper
33
33
 
@@ -84,7 +84,7 @@ module CapGun
84
84
  class Mailer < ActionMailer::Base
85
85
  include CapGun::Helper
86
86
  DEFAULT_SENDER = %("CapGun" <cap_gun@example.com>)
87
- DEFAULT_EMAIL_PREFIX = "[DEPLOY] "
87
+ DEFAULT_EMAIL_PREFIX = "[DEPLOY]"
88
88
 
89
89
  adv_attr_accessor :email_prefix
90
90
  attr_accessor :summary
@@ -107,7 +107,7 @@ module CapGun
107
107
  self.summary = create_summary(capistrano)
108
108
 
109
109
  content_type "text/plain"
110
- subject "#{email_prefix} #{capistrano[:application]} deployed to #{capistrano[:rails_env]}"
110
+ subject "#{email_prefix} #{capistrano[:application]} #{deployed_to(capistrano)}"
111
111
  body create_body(capistrano)
112
112
  end
113
113
 
@@ -115,6 +115,10 @@ module CapGun
115
115
  %[#{capistrano[:application]} was deployed#{" to " << capistrano[:rails_env] if capistrano[:rails_env]} by #{current_user} at #{humanize_release_time(capistrano[:current_release])}.]
116
116
  end
117
117
 
118
+ def deployed_to(capistrano)
119
+ returning(s = "deployed") { s += " to #{capistrano[:rails_env]}" if capistrano[:rails_env] }
120
+ end
121
+
118
122
  # Create the body of the message using a bunch of values from Capistrano
119
123
  def create_body(capistrano)
120
124
  <<-EOL
data/spec/cap_gun_spec.rb CHANGED
@@ -114,15 +114,18 @@ describe "CapGun" do
114
114
 
115
115
  describe "creating body" do
116
116
  it "has a friendly summary line" do
117
+ CapGun::Mailer.any_instance.stubs(:current_user).returns("jdoe")
117
118
  capistrano = { :application => "my app", :rails_env => "staging", :current_release => "/data/foo/releases/20080227120000", :cap_gun_email_envelope => { :from => "booyakka!@example.com", :recipients => ["foo@here.com", "bar@here.com"] } }
118
119
  mail = CapGun::Mailer.create_deployment_notification capistrano
119
- mail.body.split("\n").first.should == "my app was deployed to staging by rsanheim at February 27th, 2008 8:00 AM EDT."
120
+ mail.body.split("\n").first.should == "my app was deployed to staging by jdoe at February 27th, 2008 8:00 AM EDT."
120
121
  end
121
122
 
122
123
  it "does not include rails env in summary if not defined" do
124
+ CapGun::Mailer.any_instance.stubs(:current_user).returns("jdoe")
123
125
  capistrano = { :application => "my app", :current_release => "/data/foo/releases/20080227120000", :cap_gun_email_envelope => { :from => "booyakka!@example.com", :recipients => ["foo@here.com", "bar@here.com"] } }
124
126
  mail = CapGun::Mailer.create_deployment_notification capistrano
125
- mail.body.split("\n").first.should == "my app was deployed by rsanheim at February 27th, 2008 8:00 AM EDT."
127
+ mail.subject.should == "[DEPLOY] my app deployed"
128
+ mail.body.split("\n").first.should == "my app was deployed by jdoe at February 27th, 2008 8:00 AM EDT."
126
129
  end
127
130
 
128
131
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relevance-cap_gun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Sanheim, Relevance
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- date: 2008-06-29 21:00:00 -07:00
10
+ cert_chain: []
11
+
12
+ date: 2008-07-04 00:00:00 -07:00
12
13
  default_executable:
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: echoe
16
- type: :development
17
17
  version_requirement:
18
18
  version_requirements: !ruby/object:Gem::Requirement
19
19
  requirements:
@@ -23,7 +23,6 @@ dependencies:
23
23
  version:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: echoe
26
- type: :development
27
26
  version_requirement:
28
27
  version_requirements: !ruby/object:Gem::Requirement
29
28
  requirements: