capistrano-blaze 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.9.3@capistrano-campfire2
1
+ rvm 1.9.3@capistrano-blaze
data/README.md CHANGED
@@ -50,7 +50,6 @@ $ cap campfire:test_config
50
50
  ## Todo
51
51
 
52
52
  * Configure what kinds of messages are displayed
53
- * Don't depend on the multistage extension
54
53
 
55
54
  ## Contributing
56
55
 
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task :default => :spec
@@ -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}
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Blaze
3
- VERSION = '0.0.2'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -35,21 +35,31 @@ module Capistrano
35
35
  end
36
36
 
37
37
  def failure(context, exception)
38
- speak ":warning: #{user} failed to deploy to the #{context.stage} stage of #{context.application}, via `#{command}`: #{exception.to_s} (#{exception.class.inspect})"
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 to the #{context.stage} stage of #{context.application}, via `#{command}`"
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.2
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-03-29 00:00:00.000000000 Z
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: &70096650930420 !ruby/object:Gem::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: *70096650930420
25
+ version_requirements: *70320790341820
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: webmock
27
- requirement: &70096650929920 !ruby/object:Gem::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: *70096650929920
36
+ version_requirements: *70320790341320
36
37
  description: A simple campfire plugin for capistrano
37
38
  email:
38
39
  - iain@iain.nl