terraform_landscape 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98a71818264c2488766b447e16abbd2be9eb743ddd8faf717df0b0652742ea36
|
4
|
+
data.tar.gz: 883c3799319b75efb960a6e185897a581d2362e4499c0f442dcf155669221d04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d49d670112420768a487c6f69a009923a75607d8cfcc58beffa8824c96aec6ddd931a8c71b2281a69ea300558be4b05ce2058fb57b0ac1df101dac3e7fee0104
|
7
|
+
data.tar.gz: 42b90645cf8ab30928c2257afc11ebf943afe1216e9983f14c652808e8d22cd0a7b3cc9e988fa384b0158003696ed60b985b0b18959b7c2b80ff99497b574382
|
@@ -54,6 +54,12 @@ module TerraformLandscape
|
|
54
54
|
# Remove separation lines that appear after refreshing state
|
55
55
|
scrubbed_output.gsub!(/^-+$/, '')
|
56
56
|
|
57
|
+
if (matches = scrubbed_output.scan(/^Warning:.*$/))
|
58
|
+
matches.each do |warning|
|
59
|
+
@output.puts warning.colorize(:yellow)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
57
63
|
# Remove preface
|
58
64
|
if (match = scrubbed_output.match(/^Path:[^\n]+/))
|
59
65
|
scrubbed_output = scrubbed_output[match.end(0)..-1]
|
@@ -2,6 +2,7 @@ require 'colorize'
|
|
2
2
|
require 'diffy'
|
3
3
|
require 'json'
|
4
4
|
require 'treetop'
|
5
|
+
require 'string_undump'
|
5
6
|
|
6
7
|
########################################################################
|
7
8
|
# Represents the parsed output of `terraform plan`.
|
@@ -167,7 +168,8 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
167
168
|
end
|
168
169
|
end
|
169
170
|
|
170
|
-
|
171
|
+
# rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
|
172
|
+
def display_modified_attribute(
|
171
173
|
change_color,
|
172
174
|
attribute_name,
|
173
175
|
attribute_value,
|
@@ -175,12 +177,12 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
175
177
|
attribute_value_indent,
|
176
178
|
attribute_value_indent_amount
|
177
179
|
)
|
178
|
-
# Since the attribute line is always of the form
|
179
|
-
|
180
|
-
|
181
|
-
|
180
|
+
# Since the attribute line is always of the form "old value" => "new value"
|
181
|
+
attribute_value =~ /^ *(".*") *=> *(".*") *$/
|
182
|
+
old = Regexp.last_match[1].undump
|
183
|
+
new = Regexp.last_match[2].undump
|
182
184
|
|
183
|
-
return if old == new # Don't show unchanged attributes
|
185
|
+
return if old == new && new != '<sensitive>' # Don't show unchanged attributes
|
184
186
|
|
185
187
|
@out.print " #{attribute_name}:".ljust(attribute_value_indent_amount, ' ')
|
186
188
|
.colorize(change_color)
|
@@ -217,7 +219,7 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
217
219
|
@out.print " #{attribute_name}:".ljust(attribute_value_indent_amount, ' ')
|
218
220
|
.colorize(change_color)
|
219
221
|
|
220
|
-
evaluated_string =
|
222
|
+
evaluated_string = attribute_value.undump
|
221
223
|
if json?(evaluated_string)
|
222
224
|
@out.print to_pretty_json(evaluated_string).gsub("\n",
|
223
225
|
"\n#{attribute_value_indent}")
|
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.2.
|
4
|
+
version: 0.2.2
|
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: 2018-
|
12
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '3.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: string_undump
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.1.1
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.1.1
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: treetop
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
120
|
version: '0'
|
107
121
|
requirements: []
|
108
122
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.7.
|
123
|
+
rubygems_version: 2.7.7
|
110
124
|
signing_key:
|
111
125
|
specification_version: 4
|
112
126
|
summary: Pretty-print Terraform plan output
|