terraform_landscape 0.1.1 → 0.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d41f446c190ff599a75b12d4bedd7efaeb2ca8d1
|
4
|
+
data.tar.gz: 4a9a397f85381666a3350a3ec78e98c222b9a4ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db539abe27265275f2d7261c7219a6580044821e2fd6feecd1fd05ff2ab06f70fe180fe60389c7b3a2a5fd6eaa90aabf32b3a0c59b73c857ab197807b0e95160
|
7
|
+
data.tar.gz: 5f008c8351cbe25da8b90e0dfe09ea9104ce9eb5f55832c4f22cb9a0bbcc5e2ad5469399befcb6488e464c2b039954833f40e873b79f72ed9d476bce0613e048
|
@@ -38,9 +38,24 @@ grammar TerraformPlan
|
|
38
38
|
end
|
39
39
|
|
40
40
|
rule resource_header
|
41
|
-
change:('~' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[a-zA-Z0-9_-]+ {
|
41
|
+
change:('~' / '-/+' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[a-zA-Z0-9_-]+ _ '(' reason:[^)]+ ')' {
|
42
42
|
def to_ast
|
43
|
-
{
|
43
|
+
{
|
44
|
+
change: change.text_value.to_sym,
|
45
|
+
resource_type: type.text_value,
|
46
|
+
resource_name: name.text_value,
|
47
|
+
reason: reason.text_value,
|
48
|
+
}
|
49
|
+
end
|
50
|
+
}
|
51
|
+
/
|
52
|
+
change:('~' / '-/+' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[a-zA-Z0-9_-]+ {
|
53
|
+
def to_ast
|
54
|
+
{
|
55
|
+
change: change.text_value.to_sym,
|
56
|
+
resource_type: type.text_value,
|
57
|
+
resource_name: name.text_value,
|
58
|
+
}
|
44
59
|
end
|
45
60
|
}
|
46
61
|
end
|
@@ -17,7 +17,8 @@ class TerraformLandscape::TerraformPlan
|
|
17
17
|
CHANGE_SYMBOL_TO_COLOR = {
|
18
18
|
:~ => :yellow,
|
19
19
|
:- => :red,
|
20
|
-
:+ => :green
|
20
|
+
:+ => :green,
|
21
|
+
:'-/+' => :yellow
|
21
22
|
}.freeze
|
22
23
|
|
23
24
|
DEFAULT_DIFF_CONTEXT_LINES = 5
|
@@ -62,8 +63,11 @@ class TerraformLandscape::TerraformPlan
|
|
62
63
|
def display_resource(resource)
|
63
64
|
change_color = CHANGE_SYMBOL_TO_COLOR[resource[:change]]
|
64
65
|
|
65
|
-
|
66
|
-
|
66
|
+
resource_header = "#{resource[:change]} #{resource[:resource_type]}." \
|
67
|
+
"#{resource[:resource_name]}".colorize(change_color)
|
68
|
+
resource_header += " (#{resource[:reason]})" if resource[:reason]
|
69
|
+
|
70
|
+
@out.puts resource_header
|
67
71
|
|
68
72
|
# Determine longest attribute name so we align all values at same indentation
|
69
73
|
attribute_value_indent_amount = attribute_indent_amount_for_resource(resource)
|
@@ -115,7 +119,7 @@ class TerraformLandscape::TerraformPlan
|
|
115
119
|
)
|
116
120
|
attribute_value_indent = ' ' * attribute_value_indent_amount
|
117
121
|
|
118
|
-
if resource[:change]
|
122
|
+
if [:~, :'-/+'].include?(resource[:change])
|
119
123
|
display_modified_attribute(change_color,
|
120
124
|
attribute_name,
|
121
125
|
attribute_value,
|
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.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: 2017-03-
|
12
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|