jack-eb 1.0.0 → 1.0.1

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: a047e679f12ee31c5d0c3a86a974adcc8ad8f30f
4
- data.tar.gz: 2cad48d93339fd87951e8d0ab5f619e0280ca71e
3
+ metadata.gz: 76b0040e5d118b1213b149fe176b254c3205402b
4
+ data.tar.gz: 1c2e8104fd6e56b05e5de6d940ae8a37308e7a55
5
5
  SHA512:
6
- metadata.gz: 32f05d8317963876587a365b9e82f57a6e9ad6aad44f823c2619b7c8e8258c7b42550a7befebb918739d759b2f77a01c781914ace6678aff37501a63bdbd714f
7
- data.tar.gz: 909ff57870b2cf7137f444489edb1b90b39b1aaedbf4d643bbe12c2bfff031b3afd644e998bd6403ecec1080b2222fa9349a29f7354af48dd79eba80b1642fa7
6
+ metadata.gz: 2d7c4d5fc2d1db074b7e77a8c2ad0d1e7f3578f3b522fb0be7feb51a36be0c8efdf1482032febfb7fd92b257c1f03cd33258e428f5fc7996797309393c2afb88
7
+ data.tar.gz: 18d00db24f042dd4d1d8ad18616b540c2e097656e16c490a572d1f7a7ce2c2f73f840fec094061ad2d8d6ec581b203e9ad772da1336cbc81afdb22619e4db3c7
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.0.1]
7
+ - improve jack eb install error message
8
+
6
9
  ## [1.0.0]
7
10
  - allow --help or -h at the end of the command
8
11
  - major version bump. been in used and tested for a while now
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Jack and the Elastic Beanstalk
2
2
 
3
3
  [![ReadmeCI](http://www.readmeci.com/images/readmeci-badge.svg)](http://www.readmeci.com/tongueroo/jack)
4
- [![Build Status](https://travis-ci.org/tongueroo/jack.svg?branch=master)](https://travis-ci.org/tongueroo/jack)
4
+ [![CircleCI](https://circleci.com/gh/tongueroo/jack.svg?style=svg)](https://circleci.com/gh/tongueroo/jack)
5
5
  [![Code Climate](https://codeclimate.com/github/tongueroo/jack/badges/gpa.svg)](https://codeclimate.com/github/tongueroo/jack)
6
6
  [![Test Coverage](https://codeclimate.com/github/tongueroo/jack/badges/coverage.svg)](https://codeclimate.com/github/tongueroo/jack)
7
7
 
data/jack.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["tongueroo@gmail.com"]
11
11
  spec.description = %q{Wrapper tool to manage AWS Elastic Beanstalk environments}
12
12
  spec.summary = %q{Wrapper tool to manage AWS Elastic Beanstalk environments}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/tongueroo/jack"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -25,7 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake"
27
27
  spec.add_development_dependency "pry"
28
- spec.add_development_dependency "guard"
29
- spec.add_development_dependency "guard-bundler"
30
- spec.add_development_dependency "guard-rspec"
28
+ spec.add_development_dependency "rspec"
31
29
  end
data/lib/jack/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jack
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -3,12 +3,13 @@ module Jack
3
3
  REQUIRED_VERSION = "3.1.2"
4
4
 
5
5
  def run
6
- leave("eb cli tool is not installed") unless system("type eb > /dev/null 2>&1")
7
- leave("eb version is too low") unless check
6
+ leave(not_installed) unless system("type eb > /dev/null 2>&1")
7
+ leave(version_too_low) unless check
8
+ # "SORRY: #{message}, please install at least version #{REQUIRED_VERSION}")
8
9
  end
9
10
 
10
11
  def check
11
- major, minor, patch = parse_version(get_version)
12
+ major, minor, patch = normalize_version(parsed_version)
12
13
  r_major, r_minor, r_patch = normalize_version(REQUIRED_VERSION)
13
14
  (major > r_major) ||
14
15
  (major == r_major && minor > r_minor) ||
@@ -19,19 +20,46 @@ module Jack
19
20
  `eb --version`
20
21
  end
21
22
 
23
+ def parsed_version
24
+ @parsed_version ||= parse_version(get_version)
25
+ end
26
+
22
27
  def parse_version(version)
23
28
  parsed = version.match(/EB CLI (\d+\.\d+\.\d+)/)[1]
24
- normalize_version(parsed)
25
29
  end
26
30
 
31
+
27
32
  def normalize_version(parsed)
28
33
  parsed.split('.').collect(&:to_i)
29
34
  end
30
35
 
36
+ def not_installed
37
+ message = "Unable to detect an installation of the eb cli tool. Please install the eb tool.\n\n"
38
+ message << install_instructions
39
+ message
40
+ end
41
+
42
+ def version_too_low
43
+ <<~EOS
44
+ Unable to detect a version of the eb cli tool that works with jack.
45
+ Detected version #{parsed_version}.
46
+
47
+ #{install_instructions}
48
+ EOS
49
+ end
50
+
51
+ def install_instructions
52
+ if RUBY_PLATFORM =~ /darwin/
53
+ "You can install the eb tool via homebrew:\n\nbrew install awsebcli"
54
+ else
55
+ "Installation instructions: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html"
56
+ end
57
+ end
58
+
31
59
  # for specs
32
- def leave(message='')
33
- puts("SORRY: #{message}, please install at least version #{REQUIRED_VERSION}")
60
+ def leave(message)
61
+ puts(message)
34
62
  exit 0
35
63
  end
36
64
  end
37
- end
65
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jack-eb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -95,35 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: guard
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: guard-bundler
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: guard-rspec
98
+ name: rspec
127
99
  requirement: !ruby/object:Gem::Requirement
128
100
  requirements:
129
101
  - - ">="
@@ -195,7 +167,7 @@ files:
195
167
  - spec/lib/verison_checker_spec.rb
196
168
  - spec/spec_helper.rb
197
169
  - spec/support/fake_project.rb
198
- homepage: ''
170
+ homepage: https://github.com/tongueroo/jack
199
171
  licenses:
200
172
  - MIT
201
173
  metadata: {}