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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b05b45cc2b98cbf5b31abb8ba1dbec5577df4eafbe1b8509fcc67e340a4cd94
4
- data.tar.gz: 7ca9d608ace6c9cb6969cd5a20ff8cb8cce4d2dcd818ddd7c16bef18689800ce
3
+ metadata.gz: 40166cca660dc61e95b7b9983f757c4e3c148005226006167adebea38c5922bb
4
+ data.tar.gz: 8140497c2e9c0a7acb5bce2967157a47b796bb2e0c716b70477cfac936a55fbd
5
5
  SHA512:
6
- metadata.gz: b4a23f61538fb6c287684890e478f6ccc953843255e8fa8fa5eda4ea6ad0dd1701a81f450e1444a09b1d30fc4ca6433b251ef14a65260ab742268af262d60e89
7
- data.tar.gz: 6175d49446d7cd61873a64199cc2589f9b82ce94b28028a5812c3e1e10bf6f780684ec040b5b561c2d1c6afa1ed6fc7e3d3fb9bf8c5013768dc63650ec1d35a2
6
+ metadata.gz: a6d0e5d37e4a84ed32d97e12af6af490cbfd9d08323cc811e58dcdd7595f6aed067c9f7348a2da1ce591e7c00556c305df3e4492a8644006be864b54f1d8f475
7
+ data.tar.gz: ff0ba6c53a93af497e79ec00a75f25baa2667ed86009a475d976ecf15b949c8eded5fde7a4e69b5ae1b7f0c6126df979d945a6b7165cfe479498c2f584171668
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-terraform (1.7.0.pre.6)
4
+ ruby-terraform (1.7.0.pre.7)
5
5
  immutable-struct (~> 2.4)
6
6
  lino (~> 3.0)
7
7
 
@@ -23,6 +23,10 @@ module RubyTerraform
23
23
  @sensitive
24
24
  end
25
25
 
26
+ def render(**_)
27
+ @value.nil? ? 'null' : @value.inspect
28
+ end
29
+
26
30
  def state
27
31
  [@value, @sensitive]
28
32
  end
@@ -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
@@ -24,6 +24,10 @@ module RubyTerraform
24
24
  @sensitive
25
25
  end
26
26
 
27
+ def render(**_)
28
+ '(known after apply)'
29
+ end
30
+
27
31
  def state
28
32
  [@sensitive]
29
33
  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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyTerraform
4
- VERSION = '1.7.0.pre.6'
4
+ VERSION = '1.7.0.pre.7'
5
5
  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.6
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-20 00:00:00.000000000 Z
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