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 +4 -4
- data/lib/terraform_landscape/terraform_plan.rb +11 -1
- data/lib/terraform_landscape/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91b9f705099d647c3c28c210dabf19c7d1cfb668
|
4
|
+
data.tar.gz: ddff74252ad7f3789a60e8a403cc93c3e1157318
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
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.
|
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-
|
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
|
91
|
+
- Apache-2.0
|
92
92
|
metadata: {}
|
93
93
|
post_install_message:
|
94
94
|
rdoc_options: []
|