hanzo 0.6 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f2163d68dba551ae26f662a1e0feef58ce68189
4
- data.tar.gz: 28cd31d65ed3326257f96a45a757a0434d7ddacd
3
+ metadata.gz: d58738ec88e49b63d2b3f0363d26a97d8379bf0a
4
+ data.tar.gz: 2bd4882ff910c81a1524b611b15b3eece82854f3
5
5
  SHA512:
6
- metadata.gz: 69325cbe09fc4fac847142901acb2c5e144a65dc15546c50095600b78d94c094c0525c5322338784faca7be2a590384c7d526dd10ae664f6a848a9b1d5b08302
7
- data.tar.gz: 382cee77dcbd708ccbe8334c7211d5256b132bf06469bc8d32160247e23e84d0890f0538ac79121f90870bfd1d236aea233d87de6ffd1b8e875be8713d1b20ba
6
+ metadata.gz: 6a7a4e52c9db0b82373f56da4f949e96dbc297139c1d6215c0279140cd3b70ee9bba97c6f7fa8d433640d35ffaac984950d616e1c189f739b0782404fd0e0409
7
+ data.tar.gz: a77b0109b0d6c418f8cb16f323c7212e26ae459a0e40916e80011cb85ae4be5a4751248b5e3e6a5ea15ce7f7c9783e79754d83269ebb34aa8a22b485239790be
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017, Mirego
1
+ Copyright (c) 2013-2017, Mirego
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -5,9 +5,10 @@
5
5
  <br />
6
6
  Hanzo is a sharp tool to handle deployments of multiple environments of the same application on Heroku.
7
7
  <br /><br />
8
- <a href="https://rubygems.org/gems/hanzo"><img src="https://badge.fury.io/rb/hanzo.png" /></a>
9
- <a href="https://codeclimate.com/github/mirego/hanzo"><img src="https://codeclimate.com/github/mirego/hanzo.png" /></a>
10
- <a href="https://travis-ci.org/mirego/hanzo"><img src="https://travis-ci.org/mirego/hanzo.png?branch=master" /></a>
8
+ <a href="https://rubygems.org/gems/hanzo"><img src="http://img.shields.io/gem/v/hanzo.svg" /></a>
9
+ <a href="https://codeclimate.com/github/mirego/hanzo"><img src="http://img.shields.io/codeclimate/github/mirego/hanzo.svg" /></a>
10
+ <a href='https://gemnasium.com/mirego/hanzo'><img src="http://img.shields.io/gemnasium/mirego/hanzo.svg" /></a>
11
+ <a href="https://travis-ci.org/mirego/hanzo"><img src="http://img.shields.io/travis/mirego/hanzo.svg" /></a>
11
12
  </p>
12
13
 
13
14
  ---
@@ -87,7 +88,7 @@ Heroku labs feature for all of them.
87
88
 
88
89
  ## License
89
90
 
90
- `Hanzo` is © 2017 [Mirego](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/hanzo/blob/master/LICENSE.md) file.
91
+ `Hanzo` is © 2013-2017 [Mirego](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/hanzo/blob/master/LICENSE.md) file.
91
92
 
92
93
  ## About Mirego
93
94
 
data/lib/hanzo/base.rb CHANGED
@@ -12,7 +12,7 @@ module Hanzo
12
12
  end
13
13
 
14
14
  def extract_argument(index)
15
- (@args[index] =~ /-/) ? nil : @args[index]
15
+ @args[index]
16
16
  end
17
17
  end
18
18
  end
@@ -45,12 +45,15 @@ module Hanzo
45
45
  def run_after_deploy_commands
46
46
  return unless after_deploy_commands.any?
47
47
 
48
+ restart_needed = false
49
+
48
50
  after_deploy_commands.each do |command|
49
51
  next unless Hanzo.agree("Run `#{command}` on #{@env}?")
50
52
  Hanzo.run "heroku run #{command} --remote #{@env}"
53
+ restart_needed = true
51
54
  end
52
55
 
53
- Hanzo.run "heroku ps:restart --remote #{@env}"
56
+ Hanzo.run "heroku ps:restart --remote #{@env}" if restart_needed
54
57
  end
55
58
 
56
59
  def after_deploy_commands
data/lib/hanzo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hanzo
2
- VERSION = '0.6'.freeze
2
+ VERSION = '0.6.1'.freeze
3
3
  end
@@ -39,14 +39,33 @@ describe Hanzo::CLI do
39
39
  let(:deploy_result) { true }
40
40
 
41
41
  before do
42
- expect(Hanzo).to receive(:agree).with('Run `foo` on production?').and_return(true)
43
- expect(Hanzo).to receive(:run).with('heroku run foo --remote production')
44
- expect(Hanzo).to receive(:agree).with('Run `bar` on production?').and_return(true)
45
- expect(Hanzo).to receive(:run).with('heroku run bar --remote production')
46
- expect(Hanzo).to receive(:run).with('heroku ps:restart --remote production')
42
+ expect(Hanzo).to receive(:agree).with('Run `foo` on production?').and_return(agree_after_deploy_result)
43
+ expect(Hanzo).to receive(:agree).with('Run `bar` on production?').and_return(agree_after_deploy_result)
47
44
  end
48
45
 
49
- specify { deploy! }
46
+ context 'with after_deploy commands skipped' do
47
+ let(:agree_after_deploy_result) { false }
48
+
49
+ before do
50
+ expect(Hanzo).not_to receive(:run).with('heroku run foo --remote production')
51
+ expect(Hanzo).not_to receive(:run).with('heroku run bar --remote production')
52
+ expect(Hanzo).not_to receive(:run).with('heroku ps:restart --remote production')
53
+ end
54
+
55
+ specify { deploy! }
56
+ end
57
+
58
+ context 'without after_deploy commands skipped' do
59
+ let(:agree_after_deploy_result) { true }
60
+
61
+ before do
62
+ expect(Hanzo).to receive(:run).with('heroku run foo --remote production')
63
+ expect(Hanzo).to receive(:run).with('heroku run bar --remote production')
64
+ expect(Hanzo).to receive(:run).with('heroku ps:restart --remote production')
65
+ end
66
+
67
+ specify { deploy! }
68
+ end
50
69
  end
51
70
 
52
71
  context 'without successful deploy' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanzo
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garneau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-13 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler