tfdsl 0.1.2 → 0.1.3

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: 763557b226c240bfc0935cd389a35a79ddadddf4d5c53606d4b336c39a5f00c9
4
- data.tar.gz: f65922542151a6acffcf6a98e092790727fce4b8249b4955b094f6735de470f1
3
+ metadata.gz: 0cbd396f3294b44d7b23d414852d28ea97c92470b7f8383cfe7d7255328721d4
4
+ data.tar.gz: a4fd5051c5b6a111f298d83f571b76306bdaff2fd8d819a6dc693c6f55992d7e
5
5
  SHA512:
6
- metadata.gz: '09eaa55694335e7e5ab8130ffc987837358f7d4ecf769930bd0d4a100cab40000896419753ef1cf3fc91a94cbf051d82dad059f895fbbf985adef88911564169'
7
- data.tar.gz: 6d08d40412c61b5da9c09edae07f20d2c81f90e009cd3a74613b256297d6f2a1cb555e59b6b15494bf673e78479a3895da3d35c9f5b682ac0a31114e9857d35c
6
+ metadata.gz: d4f254f3ab80a1366183502a41fb5462b9a6f3d00dcc146c4442ff6a545e375c70b8cd4274d3822050e5dfab5708cf1999e6d41b3dbc32a01d9f556ebfd15ea2
7
+ data.tar.gz: f0f9b3eb1940f9dd8f90d1166e716f71f539b35c69438393bf36e9c24be7c4cd5d9fd3e9fe0c0ecbf1d784efab617b2b5356a67398211d15dadc511f3b31bfe1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tfdsl (0.1.2)
4
+ tfdsl (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -39,13 +39,25 @@ module TFDSL
39
39
 
40
40
  var = tf_block.instance_variable_get var_name
41
41
  var_name = var_name.to_s.delete('@')
42
+
42
43
  str << Template.list(var_name, var) if var.class == Array
43
44
  str << Template.map(var_name, var) if var.class == Hash
44
- str << Template.value(var_name, var) unless [Array, Hash].include? var.class
45
+ unless [Array, Hash].include? var.class
46
+ safe_var = safe_quote safe_multiline var
47
+ str << Template.value(var_name, safe_var)
48
+ end
45
49
  end
46
50
  str.join "\n"
47
51
  end
48
52
 
53
+ def safe_multiline(str)
54
+ str.gsub "\n", '\n'
55
+ end
56
+
57
+ def safe_quote(str)
58
+ str.gsub(/([^\\])"/, '\1\"')
59
+ end
60
+
49
61
  def child_blocks(tf_block)
50
62
  str = []
51
63
  tf_block.__blocks__.each do |b|
data/lib/tfdsl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TFDSL
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tfdsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Lopo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler