hanzo 0.4.5 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f674c358cb028c6d898cbfe965302cbebe29fc1e
4
- data.tar.gz: 035ddff1d09974cc28cf2e34fd9d355bd6ccac55
3
+ metadata.gz: 803ef303a0cfc9a80e8b5054eebeb94296170084
4
+ data.tar.gz: c4f0ae51305685c86224f45ab3b6668941e81a39
5
5
  SHA512:
6
- metadata.gz: eef2e1e94cd27dd9ee18d360011a68f9625c2c756809ecb806b460a630fc2bcab7b86813b51e224d5db69f288882b9f137458f3431bd5d5b0561a535bb958b4a
7
- data.tar.gz: b4a635f8317df367ba83f8d87f68cb752103ee575ab3dce7589e4353463712bd0ad9f6e5d71405f12fc6b8d309257f27849b32c33bdfa0404c7e19ba25901f20
6
+ metadata.gz: 07529e76fcd35dd0e11902cbe46cd93f3c5831fe46d949fc48f615afbc3abd1080f2796b8efe0de4df3ca53bd7ba580dae639cb920c4265f393b65c8d82cb8f2
7
+ data.tar.gz: 022c69701c64406218bc681857a2e24d75773cd717e608c6edc658b24410980be6b84a591892bde19b895ac8fd07fd66297cf2ca377fc2e7c97171cd16f74c10
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013, Mirego
1
+ Copyright (c) 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
@@ -3,7 +3,7 @@
3
3
  <img src="http://i.imgur.com/RZbJy1u.png" alt="Hanzo" />
4
4
  </a>
5
5
  <br />
6
- Hanzo is a sharp tool to handle deployments in multiple environments on Heroku.
6
+ Hanzo is a sharp tool to handle deployments of multiple environments of the same application on Heroku.
7
7
  <br /><br />
8
8
  <a href="https://rubygems.org/gems/hanzo"><img src="https://badge.fury.io/rb/hanzo.png" /></a>
9
9
  <a href="https://codeclimate.com/github/mirego/hanzo"><img src="https://codeclimate.com/github/mirego/hanzo.png" /></a>
@@ -14,7 +14,7 @@
14
14
 
15
15
  ## Installation
16
16
 
17
- Add this line to your application’s Gemfile:
17
+ Add this line to your application’s `Gemfile`:
18
18
 
19
19
  ```ruby
20
20
  gem 'hanzo'
@@ -22,18 +22,19 @@ gem 'hanzo'
22
22
 
23
23
  ## Usage
24
24
 
25
- Create an `.heroku-remotes` file at the root of your app that will contain the name of the
26
- environment as the key and the Heroku app name as the value.
25
+ Create an `.hanzo.yml` file at the root of your app that will contain a map of
26
+ remotes, with the remote as the key and the Heroku application name as the value.
27
27
 
28
28
  ```yaml
29
- qa: heroku-app-name-qa
30
- staging: heroku-app-name-staging
31
- production: heroku-app-name-production
29
+ remotes:
30
+ qa: heroku-app-name-qa
31
+ staging: heroku-app-name-staging
32
+ production: heroku-app-name-production
32
33
  ```
33
34
 
34
35
  ### Install remotes
35
36
 
36
- Whenever you add a new environment to your `.heroku-remotes` file, you'll have to install those
37
+ Whenever you add a new remote to your `.hanzo.yml` file, you'll have to install those
37
38
  remotes locally by running `hanzo install`.
38
39
 
39
40
  ```bash
@@ -61,8 +62,8 @@ remotes locally by running `hanzo install`.
61
62
 
62
63
  ### Install labs
63
64
 
64
- Once all your environments are activated, you might want to enable some
65
- Heroku labs feature for all your environments.
65
+ Once all your remotes are installed, you might want to enable some
66
+ Heroku labs feature for all of them.
66
67
 
67
68
  ```bash
68
69
  > bundle exec hanzo install labs
@@ -80,7 +81,7 @@ Heroku labs feature for all your environments.
80
81
 
81
82
  ## License
82
83
 
83
- `Hanzo` is © 2014 [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.
84
+ `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.
84
85
 
85
86
  ## About Mirego
86
87
 
data/Rakefile CHANGED
@@ -9,3 +9,13 @@ desc 'Run all specs'
9
9
  RSpec::Core::RakeTask.new(:spec) do |task|
10
10
  task.pattern = 'spec/**/*_spec.rb'
11
11
  end
12
+
13
+ desc 'Start an IRB session with the gem'
14
+ task :console do
15
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
16
+ require 'hanzo'
17
+ require 'irb'
18
+
19
+ ARGV.clear
20
+ IRB.start
21
+ end
data/lib/hanzo.rb CHANGED
@@ -55,6 +55,15 @@ module Hanzo
55
55
  def self.ask(question, &blk)
56
56
  HighLine.ask "-----> #{question} ", &blk
57
57
  end
58
+
59
+ def self.config
60
+ return YAML.load_file('.hanzo.yml') if File.exist?('.hanzo.yml')
61
+
62
+ Hanzo.print 'Cannot locate .hanzo.yml'
63
+ Hanzo.print 'For more information, please read https://github.com/mirego/hanzo'
64
+
65
+ exit
66
+ end
58
67
  end
59
68
 
60
69
  class String
@@ -22,10 +22,10 @@ module Hanzo
22
22
 
23
23
  deploy && run_migrations
24
24
  rescue UnknownEnvironment
25
- Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .heroku-remotes and run:\n hanzo install remotes", :red
25
+ Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .hanzo.yml and run:\n hanzo install remotes", :red
26
26
  Hanzo.unindent_print "\nFor more information, read https://github.com/mirego/hanzo#install-remotes", :red
27
27
  rescue UninstalledEnvironment
28
- Hanzo.unindent_print "Environment `#{@env}` has been found in your .heroku-remotes file. Before using it, you must install it:\n hanzo install remotes", :red
28
+ Hanzo.unindent_print "Environment `#{@env}` has been found in your .hanzo.yml file. Before using it, you must install it:\n hanzo install remotes", :red
29
29
  end
30
30
 
31
31
  def initialize_help
@@ -16,10 +16,10 @@ module Hanzo
16
16
 
17
17
  diff
18
18
  rescue UnknownEnvironment
19
- Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .heroku-remotes and run:\n hanzo install remotes", :red
19
+ Hanzo.unindent_print "Environment `#{@env}` doesn't exist. Add it to .hanzo.yml and run:\n hanzo install remotes", :red
20
20
  Hanzo.unindent_print "\nFor more information, read https://github.com/mirego/hanzo#install-remotes", :red
21
21
  rescue UninstalledEnvironment
22
- Hanzo.unindent_print "Environment `#{@env}` has been found in your .heroku-remotes file. Before using it, you must install it:\n hanzo install remotes", :red
22
+ Hanzo.unindent_print "Environment `#{@env}` has been found in your .hanzo.yml file. Before using it, you must install it:\n hanzo install remotes", :red
23
23
  end
24
24
 
25
25
  def initialize_help
@@ -31,6 +31,7 @@ module Hanzo
31
31
 
32
32
  Available install type:
33
33
  remotes - Add git remotes to current repository
34
+ labs - Enable specific labs for all environments
34
35
  BANNER
35
36
  end
36
37
  end
@@ -16,11 +16,7 @@ module Hanzo
16
16
  end
17
17
 
18
18
  def self.environments
19
- return YAML.load_file('.heroku-remotes') if File.exist?('.heroku-remotes')
20
-
21
- Hanzo.print 'Cannot locate .heroku-remotes'
22
- Hanzo.print 'For more information, please read https://github.com/mirego/hanzo'
23
- exit
19
+ Hanzo.config['remotes']
24
20
  end
25
21
 
26
22
  def self.installed_environments
data/lib/hanzo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hanzo
2
- VERSION = '0.4.5'.freeze
2
+ VERSION = '0.5'.freeze
3
3
  end
@@ -43,7 +43,7 @@ describe Hanzo::CLI do
43
43
  expect(Hanzo).to receive(:print).with(['- SMTP_PASSWORD', '- SMTP_HOST'])
44
44
  end
45
45
 
46
- it 'should install specified labs for each environment' do
46
+ it 'should list missing variables for all environments' do
47
47
  config!
48
48
  end
49
49
  end
@@ -39,7 +39,7 @@ describe Hanzo::CLI do
39
39
 
40
40
  before { expect(Hanzo).to receive(:title).with(create_remotes_title) }
41
41
 
42
- context '.heroku-remotes exists' do
42
+ context '.hanzo.yml exists' do
43
43
  before do
44
44
  expect(Hanzo::Installers::Remotes).to receive(:environments).and_return(heroku_remotes)
45
45
 
@@ -55,7 +55,7 @@ describe Hanzo::CLI do
55
55
  end
56
56
  end
57
57
 
58
- context '.heroku-remotes file is missing' do
58
+ context '.hanzo.yml file is missing' do
59
59
  before { expect(Hanzo).to receive(:print).twice }
60
60
 
61
61
  it 'should display error message' 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.4.5
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garneau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler