capistrano-blaze 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rvmrc +1 -1
- data/README.md +0 -1
- data/Rakefile +4 -0
- data/capistrano-blaze.gemspec +1 -1
- data/lib/capistrano/blaze/version.rb +1 -1
- data/lib/capistrano/blaze.rb +16 -6
- data/spec/camp_spec.rb +16 -2
- metadata +7 -6
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm 1.9.3@capistrano-
|
1
|
+
rvm 1.9.3@capistrano-blaze
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/capistrano-blaze.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require File.expand_path('../lib/capistrano/blaze/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["iain"]
|
5
|
+
gem.authors = ["iain", "rdvdijk"]
|
6
6
|
gem.email = ["iain@iain.nl"]
|
7
7
|
gem.description = %q{A simple campfire plugin for capistrano}
|
8
8
|
gem.summary = %q{A simple campfire plugin for capistrano}
|
data/lib/capistrano/blaze.rb
CHANGED
@@ -35,21 +35,31 @@ module Capistrano
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def failure(context, exception)
|
38
|
-
speak ":warning: #{user} failed to deploy
|
38
|
+
speak ":warning: #{user} failed to deploy #{stage(context)}#{context.application}, via `#{command}`: #{exception.to_s} (#{exception.class.inspect})"
|
39
39
|
end
|
40
40
|
|
41
41
|
def success(context)
|
42
|
-
speak "#{user} succesfully deployed
|
43
|
-
end
|
44
|
-
|
45
|
-
def user
|
46
|
-
`whoami`.strip
|
42
|
+
speak "#{user} succesfully deployed #{stage(context)}#{context.application}, via `#{command}`"
|
47
43
|
end
|
48
44
|
|
49
45
|
def test(context)
|
50
46
|
speak ":heart: #{context.application}!"
|
51
47
|
end
|
52
48
|
|
49
|
+
private
|
50
|
+
|
51
|
+
def stage(context)
|
52
|
+
if context.respond_to?(:stage)
|
53
|
+
"to the #{context.stage} stage of "
|
54
|
+
else
|
55
|
+
""
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def user
|
60
|
+
`whoami`.strip
|
61
|
+
end
|
62
|
+
|
53
63
|
def command
|
54
64
|
[ 'cap', *$* ] * ' '
|
55
65
|
end
|
data/spec/camp_spec.rb
CHANGED
@@ -28,14 +28,14 @@ describe Capistrano::Blaze do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "displays a failure message" do
|
31
|
-
subject.should_receive(:speak).with(":warning: iain failed to deploy to the production stage of basecamp, via `cap`: woops (RuntimeError)")
|
31
|
+
subject.should_receive(:speak).with(":warning: iain failed to deploy to the production stage of basecamp, via `cap #{ARGV.join(' ')}`: woops (RuntimeError)")
|
32
32
|
context = stub(:stage => "production", :application => "basecamp")
|
33
33
|
exception = RuntimeError.new("woops")
|
34
34
|
subject.failure(context, exception)
|
35
35
|
end
|
36
36
|
|
37
37
|
it "displays success message" do
|
38
|
-
subject.should_receive(:speak).with("iain succesfully deployed to the production stage of basecamp, via `cap`")
|
38
|
+
subject.should_receive(:speak).with("iain succesfully deployed to the production stage of basecamp, via `cap #{ARGV.join(' ')}`")
|
39
39
|
context = stub(:stage => "production", :application => "basecamp")
|
40
40
|
subject.success(context)
|
41
41
|
end
|
@@ -46,4 +46,18 @@ describe Capistrano::Blaze do
|
|
46
46
|
subject.test(context)
|
47
47
|
end
|
48
48
|
|
49
|
+
it "displays success message without a stage" do
|
50
|
+
subject.should_receive(:speak).with("iain succesfully deployed basecamp, via `cap #{ARGV.join(' ')}`")
|
51
|
+
context = stub(:application => "basecamp")
|
52
|
+
subject.success(context)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "displays failure message without a stage" do
|
56
|
+
subject.should_receive(:speak).with(":warning: iain failed to deploy basecamp, via `cap #{ARGV.join(' ')}`: woops (RuntimeError)")
|
57
|
+
context = stub(:application => "basecamp")
|
58
|
+
exception = RuntimeError.new("woops")
|
59
|
+
subject.failure(context, exception)
|
60
|
+
end
|
61
|
+
|
62
|
+
|
49
63
|
end
|
metadata
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-blaze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- iain
|
9
|
+
- rdvdijk
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
+
date: 2012-04-05 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: rspec
|
16
|
-
requirement: &
|
17
|
+
requirement: &70320790341820 !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
19
|
requirements:
|
19
20
|
- - ~>
|
@@ -21,10 +22,10 @@ dependencies:
|
|
21
22
|
version: '2.9'
|
22
23
|
type: :development
|
23
24
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
+
version_requirements: *70320790341820
|
25
26
|
- !ruby/object:Gem::Dependency
|
26
27
|
name: webmock
|
27
|
-
requirement: &
|
28
|
+
requirement: &70320790341320 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
30
|
requirements:
|
30
31
|
- - ~>
|
@@ -32,7 +33,7 @@ dependencies:
|
|
32
33
|
version: 1.8.4
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
+
version_requirements: *70320790341320
|
36
37
|
description: A simple campfire plugin for capistrano
|
37
38
|
email:
|
38
39
|
- iain@iain.nl
|