ruby-terraform 1.7.0.pre.6 → 1.7.0.pre.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ruby_terraform/models/known_value.rb +4 -0
- data/lib/ruby_terraform/models/list.rb +14 -0
- data/lib/ruby_terraform/models/map.rb +15 -0
- data/lib/ruby_terraform/models/omitted_value.rb +41 -0
- data/lib/ruby_terraform/models/unknown_value.rb +4 -0
- data/lib/ruby_terraform/models/values.rb +5 -0
- data/lib/ruby_terraform/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40166cca660dc61e95b7b9983f757c4e3c148005226006167adebea38c5922bb
|
4
|
+
data.tar.gz: 8140497c2e9c0a7acb5bce2967157a47b796bb2e0c716b70477cfac936a55fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d0e5d37e4a84ed32d97e12af6af490cbfd9d08323cc811e58dcdd7595f6aed067c9f7348a2da1ce591e7c00556c305df3e4492a8644006be864b54f1d8f475
|
7
|
+
data.tar.gz: ff0ba6c53a93af497e79ec00a75f25baa2667ed86009a475d976ecf15b949c8eded5fde7a4e69b5ae1b7f0c6126df979d945a6b7165cfe479498c2f584171668
|
data/Gemfile.lock
CHANGED
@@ -51,6 +51,19 @@ module RubyTerraform
|
|
51
51
|
@sensitive
|
52
52
|
end
|
53
53
|
|
54
|
+
def render(level: 0, indent: ' ')
|
55
|
+
return '[]' if empty?
|
56
|
+
|
57
|
+
opts = { level: level + 1, indent: indent }
|
58
|
+
extra = level.times.collect { |_| indent }.join
|
59
|
+
lines =
|
60
|
+
value
|
61
|
+
.collect { |i| "#{extra}#{indent}#{i.render(opts)}" }
|
62
|
+
.join(",\n")
|
63
|
+
|
64
|
+
"[\n#{lines}\n#{extra}]"
|
65
|
+
end
|
66
|
+
|
54
67
|
def state
|
55
68
|
[@value, @sensitive]
|
56
69
|
end
|
@@ -59,6 +72,7 @@ module RubyTerraform
|
|
59
72
|
sensitive = sensitive? ? 'sensitive' : 'non-sensitive'
|
60
73
|
"#{value.inspect} (#{sensitive})"
|
61
74
|
end
|
75
|
+
|
62
76
|
alias to_s inspect
|
63
77
|
end
|
64
78
|
end
|
@@ -47,6 +47,21 @@ module RubyTerraform
|
|
47
47
|
@sensitive
|
48
48
|
end
|
49
49
|
|
50
|
+
def render(bare: false, level: 0, indent: ' ')
|
51
|
+
return '{}' if empty?
|
52
|
+
|
53
|
+
next_level = bare ? level : level + 1
|
54
|
+
self_indent = bare ? '' : indent
|
55
|
+
opts = { level: next_level, indent: indent }
|
56
|
+
extra = level.times.collect { |_| indent }.join
|
57
|
+
lines =
|
58
|
+
value
|
59
|
+
.collect { |k, v| "#{extra}#{self_indent}#{k} = #{v.render(opts)}" }
|
60
|
+
.join("\n")
|
61
|
+
|
62
|
+
bare ? lines : "{\n#{lines}\n#{extra}}"
|
63
|
+
end
|
64
|
+
|
50
65
|
def state
|
51
66
|
[@value, @sensitive]
|
52
67
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../value_equality'
|
4
|
+
|
5
|
+
module RubyTerraform
|
6
|
+
module Models
|
7
|
+
class OmittedValue
|
8
|
+
include ValueEquality
|
9
|
+
|
10
|
+
def initialize(sensitive: false)
|
11
|
+
@sensitive = sensitive
|
12
|
+
end
|
13
|
+
|
14
|
+
def value
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
alias unbox value
|
18
|
+
|
19
|
+
def known?
|
20
|
+
false
|
21
|
+
end
|
22
|
+
|
23
|
+
def sensitive?
|
24
|
+
@sensitive
|
25
|
+
end
|
26
|
+
|
27
|
+
def render(**_)
|
28
|
+
'...'
|
29
|
+
end
|
30
|
+
|
31
|
+
def state
|
32
|
+
[@sensitive]
|
33
|
+
end
|
34
|
+
|
35
|
+
def inspect
|
36
|
+
sensitive = sensitive? ? 'sensitive' : 'non-sensitive'
|
37
|
+
"... (unknown, #{sensitive})"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -4,6 +4,7 @@ require_relative './list'
|
|
4
4
|
require_relative './map'
|
5
5
|
require_relative './known_value'
|
6
6
|
require_relative './unknown_value'
|
7
|
+
require_relative './omitted_value'
|
7
8
|
|
8
9
|
module RubyTerraform
|
9
10
|
module Models
|
@@ -17,6 +18,10 @@ module RubyTerraform
|
|
17
18
|
UnknownValue.new(sensitive: sensitive)
|
18
19
|
end
|
19
20
|
|
21
|
+
def omitted(sensitive: false)
|
22
|
+
OmittedValue.new(sensitive: sensitive)
|
23
|
+
end
|
24
|
+
|
20
25
|
def list(value, sensitive: false)
|
21
26
|
List.new(value, sensitive: sensitive)
|
22
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-terraform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.0.pre.
|
4
|
+
version: 1.7.0.pre.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfraBlocks Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: immutable-struct
|
@@ -323,6 +323,7 @@ files:
|
|
323
323
|
- lib/ruby_terraform/models/list.rb
|
324
324
|
- lib/ruby_terraform/models/map.rb
|
325
325
|
- lib/ruby_terraform/models/objects.rb
|
326
|
+
- lib/ruby_terraform/models/omitted_value.rb
|
326
327
|
- lib/ruby_terraform/models/plan.rb
|
327
328
|
- lib/ruby_terraform/models/resource_change.rb
|
328
329
|
- lib/ruby_terraform/models/unknown_value.rb
|