tacoma 1.0.12 → 1.0.13

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: b4c0fa806b894208e53ad3bd5ecd00e36285855b
4
- data.tar.gz: 185e15e296c11fcfc138ce5299995ecfa4a7db6b
3
+ metadata.gz: 8c9da06bc8a4fc6ad6ef4e2b71e5b27446472442
4
+ data.tar.gz: 6fa8578c3510a586acb5218ada7f7a8bc3fab195
5
5
  SHA512:
6
- metadata.gz: 4ced14e1f23035c5cd6fe6d116a98d19de8b26a28157c7760e6d70e04243ec029243cee8305208ba24601ae9354d9d2edf4055c1736d3cfb5a52e93f72628e12
7
- data.tar.gz: 2daf30e0eab0de3a9068379ac7bc2e1d40b0038dff1fbb22ec87691fdd005102913f4bc8fab16c100a25feb69ff13a4675f49ccb51918da227d0bfc34e6c90bd
6
+ metadata.gz: e697d3fcc7bae802ae2cbee315bc6e930682810ed979970901ce397b26c19dd1b6871dfd6633b9b11ac37304dd7ccc1a1ea32f7d64e89c809eb7eb6f89a1dd72
7
+ data.tar.gz: d1bd30c973cbe8e6cbe4f993b16d1e28bedb6fb788d363cc4e0cb928d2f9a4c046c8375ea17ee0941aa81111f3e09d09ed6c3703ce59e0f00d33dd1f74bad410
@@ -33,6 +33,7 @@ module Tacoma
33
33
  @aws_access_key_id = config[environment]['aws_access_key_id']
34
34
  @region = config[environment]['region'] || DEFAULT_AWS_REGION
35
35
  @repo = config[environment]['repo']
36
+ validate_vars
36
37
  end
37
38
 
38
39
  # Assume there is a ~/.aws/credentials file with a valid format
@@ -41,6 +42,18 @@ module Tacoma
41
42
  end
42
43
 
43
44
  private
45
+
46
+ # shows error message if any attr is missing
47
+ # return false if any attr is missing to exit the program
48
+ def validate_vars
49
+ errors = self.instance_variables.map do |var|
50
+ next unless instance_variable_get(var).to_s.empty?
51
+ "Cannot find #{var} key, check your YAML config file."
52
+ end.compact
53
+ puts errors.join("\n") if errors
54
+ errors.empty?
55
+ end
56
+
44
57
  def exists?(environment)
45
58
  config = Tool.config
46
59
  if config.keys.include?(environment) == false
@@ -1,3 +1,3 @@
1
1
  module Tacoma
2
- VERSION='1.0.12'
2
+ VERSION='1.0.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tacoma
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lupión
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.4.6
114
+ rubygems_version: 2.4.8
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: This tool reads a YAML file with the credentials for your AWS accounts and