terraform_landscape 0.1.2 → 0.1.3

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: d41f446c190ff599a75b12d4bedd7efaeb2ca8d1
4
- data.tar.gz: 4a9a397f85381666a3350a3ec78e98c222b9a4ef
3
+ metadata.gz: 91b9f705099d647c3c28c210dabf19c7d1cfb668
4
+ data.tar.gz: ddff74252ad7f3789a60e8a403cc93c3e1157318
5
5
  SHA512:
6
- metadata.gz: db539abe27265275f2d7261c7219a6580044821e2fd6feecd1fd05ff2ab06f70fe180fe60389c7b3a2a5fd6eaa90aabf32b3a0c59b73c857ab197807b0e95160
7
- data.tar.gz: 5f008c8351cbe25da8b90e0dfe09ea9104ce9eb5f55832c4f22cb9a0bbcc5e2ad5469399befcb6488e464c2b039954833f40e873b79f72ed9d476bce0613e048
6
+ metadata.gz: f82cf312cb0eaaf8a168fd1afaa4cad0769fb9c4f8ed0f8f91fe844688c4d8b98702fb293120787fe2a5b95bb4187d0933a68100653bd271602362d325cc33cc
7
+ data.tar.gz: 0aacb42793c47b5c6d55bdfbeda4a1eddb7aa3e28c14cc08b52b6e4724ee4b828cf64150a784e079db240a790c61b54cabb9e5e93056ccad69bbe417be49924d
@@ -65,7 +65,7 @@ class TerraformLandscape::TerraformPlan
65
65
 
66
66
  resource_header = "#{resource[:change]} #{resource[:resource_type]}." \
67
67
  "#{resource[:resource_name]}".colorize(change_color)
68
- resource_header += " (#{resource[:reason]})" if resource[:reason]
68
+ resource_header += " (#{resource[:reason]})".colorize(:magenta) if resource[:reason]
69
69
 
70
70
  @out.puts resource_header
71
71
 
@@ -141,6 +141,14 @@ class TerraformLandscape::TerraformPlan
141
141
  attribute_value_indent,
142
142
  attribute_value_indent_amount
143
143
  )
144
+ # Handle case where attribute has an annotation (e.g. "forces new resource")
145
+ # appended onto the end. This is hard to parse in the Treetop grammar, so we
146
+ # instead catch it here and extract
147
+ if match = attribute_value.match(/\((?<reason>[^)]+)\)$/)
148
+ reason = match['reason']
149
+ attribute_value = attribute_value[0...match.begin(0)]
150
+ end
151
+
144
152
  # Since the attribute line is always of the form
145
153
  # "old value" => "new value", we can add curly braces and parse with
146
154
  # `eval` to obtain a hash with a single key/value.
@@ -166,6 +174,8 @@ class TerraformLandscape::TerraformPlan
166
174
  @out.print '"' + new.colorize(:green) + '"'
167
175
  end
168
176
 
177
+ @out.print " (#{reason})".colorize(:magenta) if reason
178
+
169
179
  @out.newline
170
180
  end
171
181
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module TerraformLandscape
5
- VERSION = '0.1.2'.freeze
5
+ VERSION = '0.1.3'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraform_landscape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coinbase
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-22 00:00:00.000000000 Z
12
+ date: 2017-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -88,7 +88,7 @@ files:
88
88
  - lib/terraform_landscape/version.rb
89
89
  homepage: https://github.com/coinbase/terraform_landscape
90
90
  licenses:
91
- - Apache 2.0
91
+ - Apache-2.0
92
92
  metadata: {}
93
93
  post_install_message:
94
94
  rdoc_options: []