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 +4 -4
- data/lib/terraform-synthesizer/version.rb +1 -1
- data/lib/terraform-synthesizer.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e46ceaa4274fb5f383bee9f7648bf679dd84cca8c934783164f0c8f4934a5e02
|
4
|
+
data.tar.gz: 75acf8ac7a778b85e1c00eb344a9dafd4b2c33acfaefb563ef2bc3f0b4d1c126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e559936d6d355a4f10c87e9c0e85de52809fd4330a46e34d225dea2b5dc86105070a9cb808e158dcbb0103c2df70ff8f762f39f45bb51d81f4253610832422a
|
7
|
+
data.tar.gz: 7480f234c6a74075a45ecb9cee29c656dc45831b3931e73f6097fdb4b0d983d3c5967f76375aa88bedfdcf1288986fca8ed099df9bae64e15a1bd6181a62d0e2
|
@@ -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,
|