terraform-synthesizer 0.0.9 → 0.0.10

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: ef5d1658dd13a807e64a11889c5d5d0eec71705e26247fc2220abfbb74caaf17
4
- data.tar.gz: a9ee84f936fba14815cd7317a8ca09ea3fea63dcc0997547b9024e00ff41f401
3
+ metadata.gz: e46ceaa4274fb5f383bee9f7648bf679dd84cca8c934783164f0c8f4934a5e02
4
+ data.tar.gz: 75acf8ac7a778b85e1c00eb344a9dafd4b2c33acfaefb563ef2bc3f0b4d1c126
5
5
  SHA512:
6
- metadata.gz: 98ce74c15e089c8743b2ce9d9de7e9d2431af9733b6917cb09cff3b6fbb67c12ff25ae1f84475706d9a4226126a3f7cc26c1b27a0bac66b5a581187a0ab219e8
7
- data.tar.gz: 894c7ad6fe4f8a8ac651701e04f19f5b02988df36552a6db3dbcbdc59a13810ea1e1acb69a75cf5c64adad0c34eeebe39c6e9fc412829c7f1c058855c65d43fb
6
+ metadata.gz: 4e559936d6d355a4f10c87e9c0e85de52809fd4330a46e34d225dea2b5dc86105070a9cb808e158dcbb0103c2df70ff8f762f39f45bb51d81f4253610832422a
7
+ data.tar.gz: 7480f234c6a74075a45ecb9cee29c656dc45831b3931e73f6097fdb4b0d983d3c5967f76375aa88bedfdcf1288986fca8ed099df9bae64e15a1bd6181a62d0e2
@@ -1,3 +1,3 @@
1
1
  module TerraformSynthesizer
2
- VERSION = %(0.0.9).freeze
2
+ VERSION = %(0.0.10).freeze
3
3
  end
@@ -2,11 +2,21 @@ require %(abstract-synthesizer)
2
2
 
3
3
  class TerraformSynthesizer < AbstractSynthesizer
4
4
  def method_missing(method_name, ...)
5
+ if @in_locals
6
+ if args[0].nil?
7
+ raise ArgumentError,
8
+ %(not assigning anything to this local #{method_name})
9
+ end
10
+
11
+ @translation[:template][:locals][method_name.to_sym] = args[0]
12
+ @in_locals = false
13
+ end
5
14
  if method_name.to_s.eql?(%(locals))
6
15
  @translation = {} if @translation.nil?
7
16
  @translation[:template] = {} if @translation[:template].nil?
8
17
  @translation[:template][:locals] = {} if @translation[:template][:locals].nil?
9
18
  @translation[:template][:locals].merge!(yield) if block_given?
19
+ @in_locals = true
10
20
  else
11
21
  abstract_method_missing(
12
22
  method_name,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraform-synthesizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - drzthslnt@gmail.com