terraform_landscape 0.1.3 → 0.1.4

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: 91b9f705099d647c3c28c210dabf19c7d1cfb668
4
- data.tar.gz: ddff74252ad7f3789a60e8a403cc93c3e1157318
3
+ metadata.gz: 4e473d9b7fc9ba1dfb6aa4e6eb8ce84f89d7538f
4
+ data.tar.gz: ca056858b47534dc76b4aac00c5521a33341a5f2
5
5
  SHA512:
6
- metadata.gz: f82cf312cb0eaaf8a168fd1afaa4cad0769fb9c4f8ed0f8f91fe844688c4d8b98702fb293120787fe2a5b95bb4187d0933a68100653bd271602362d325cc33cc
7
- data.tar.gz: 0aacb42793c47b5c6d55bdfbeda4a1eddb7aa3e28c14cc08b52b6e4724ee4b828cf64150a784e079db240a790c61b54cabb9e5e93056ccad69bbe417be49924d
6
+ metadata.gz: c7734d6eebd5dc79d484ba6f42253ce44aff827c7c043b46885d43339376a516b44f49bb83515d91eb1f8ac7547a00f4ac8d0cdee25a712124bb7595088183f0
7
+ data.tar.gz: be7098873b06c67e829a6ecdb7b48837732998e6baf806866ba52abaabce0475aff48849eb38c51d3c71a043e35e5a693231ad826ba5fa8bf9fc855d290313ae
@@ -30,7 +30,7 @@ grammar TerraformPlan
30
30
  end
31
31
  }
32
32
  /
33
- header:resource_header "\n" {
33
+ header:resource_header {
34
34
  def to_ast
35
35
  header.to_ast.merge(attributes: {})
36
36
  end
@@ -38,7 +38,7 @@ grammar TerraformPlan
38
38
  end
39
39
 
40
40
  rule resource_header
41
- change:('~' / '-/+' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[a-zA-Z0-9_-]+ _ '(' reason:[^)]+ ')' {
41
+ change:('~' / '-/+' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[\S]+ _ '(' reason:[^)]+ ')' {
42
42
  def to_ast
43
43
  {
44
44
  change: change.text_value.to_sym,
@@ -49,7 +49,7 @@ grammar TerraformPlan
49
49
  end
50
50
  }
51
51
  /
52
- change:('~' / '-/+' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[a-zA-Z0-9_-]+ {
52
+ change:('~' / '-/+' / '-' / '+') _ type:[a-zA-Z0-9_-]+ '.' name:[\S]+ {
53
53
  def to_ast
54
54
  {
55
55
  change: change.text_value.to_sym,
@@ -94,6 +94,9 @@ class TerraformLandscape::TerraformPlan
94
94
  end
95
95
 
96
96
  def to_pretty_json(value)
97
+ # Can't JSON.parse an empty string, so handle it separately
98
+ return '' if value.strip.empty?
99
+
97
100
  JSON.pretty_generate(JSON.parse(value),
98
101
  {
99
102
  indent: ' ',
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module TerraformLandscape
5
- VERSION = '0.1.3'.freeze
5
+ VERSION = '0.1.4'.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.3
4
+ version: 0.1.4
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-23 00:00:00.000000000 Z
12
+ date: 2017-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.6.10
109
+ rubygems_version: 2.6.11
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Pretty-print Terraform plan output