terraform_landscape 0.3.1 → 0.3.2
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 -3
- data/lib/terraform_landscape/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71f22a7ae9d3dbbc5d2c763bf68d25f20c8e08218ae2e30452050ce20cf488c4
|
4
|
+
data.tar.gz: 4d328acc7803b44431fccdde6b8ea494d578a4325e9d02c250fe8de743b79597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a6d279f8e791d657faf8efa9b8f06191b75d2ad49bc88f8321abe1eae8d61c5d2fc731e6744d761d6189c936e2a64f45a36f6ea51dcd1717382916411830dc0
|
7
|
+
data.tar.gz: 6f3be4f83a3c7f3d47617d0a74d81f78c0c38064c6b5aeec032318ddb4c7999e8b94178c96587c756605e67b142c11b80dc6f1b82acb0b42fce25a88861bc629
|
@@ -24,6 +24,10 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
24
24
|
|
25
25
|
DEFAULT_DIFF_CONTEXT_LINES = 5
|
26
26
|
|
27
|
+
UNICODE_ESCAPER = proc { |s|
|
28
|
+
format('\u%04X', s.codepoints[0])
|
29
|
+
}
|
30
|
+
|
27
31
|
class ParseError < StandardError; end
|
28
32
|
|
29
33
|
class << self
|
@@ -102,6 +106,10 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
102
106
|
longest_name_length + 8
|
103
107
|
end
|
104
108
|
|
109
|
+
def undump(value)
|
110
|
+
value.encode('ASCII', fallback: UNICODE_ESCAPER).undump
|
111
|
+
end
|
112
|
+
|
105
113
|
def json?(value)
|
106
114
|
['{', '['].include?(value.to_s[0]) &&
|
107
115
|
(JSON.parse(value) rescue nil) # rubocop:disable Style/RescueModifier
|
@@ -178,8 +186,8 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
178
186
|
)
|
179
187
|
# Since the attribute line is always of the form "old value" => "new value"
|
180
188
|
attribute_value =~ /^ *(".*") *=> *(".*") *$/
|
181
|
-
old = Regexp.last_match[1]
|
182
|
-
new = Regexp.last_match[2]
|
189
|
+
old = undump(Regexp.last_match[1])
|
190
|
+
new = undump(Regexp.last_match[2])
|
183
191
|
|
184
192
|
return if old == new && new != '<sensitive>' # Don't show unchanged attributes
|
185
193
|
|
@@ -218,7 +226,7 @@ class TerraformLandscape::TerraformPlan # rubocop:disable Metrics/ClassLength
|
|
218
226
|
@out.print " #{attribute_name}:".ljust(attribute_value_indent_amount, ' ')
|
219
227
|
.colorize(change_color)
|
220
228
|
|
221
|
-
evaluated_string = attribute_value
|
229
|
+
evaluated_string = undump(attribute_value)
|
222
230
|
if json?(evaluated_string)
|
223
231
|
@out.print to_pretty_json(evaluated_string).gsub("\n",
|
224
232
|
"\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.3.
|
4
|
+
version: 0.3.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: 2019-
|
12
|
+
date: 2019-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
|
-
rubygems_version: 3.0.
|
108
|
+
rubygems_version: 3.0.3
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Pretty-print Terraform plan output
|