jcompiler 0.1.108 → 0.1.109
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/build +1 -1
- data/lib/jcompiler/provider.rb +16 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2ec0564fadc4684c4b0cafc2b4dd894c9de3a25
|
4
|
+
data.tar.gz: 205036178218fa9ec453238d678024a1b806b50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b34fa53bf48af5be36d6267748d4eb1a1cb33c98ef76c965da7d75ef4db5fb9a61f2688fc6e060d16b4f926e04a5792e653b35b3fc583bf120583f949a16691
|
7
|
+
data.tar.gz: cdbce9e6fda20db5b6e53a0832b27afd33ad79adb5a12ee37acdd24d5065be48f03b22d5aabe0765c5302fb5a465ef9615b60068405f9992e719cd0a5da7bdec
|
data/build
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
110
|
data/lib/jcompiler/provider.rb
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
class Jcompiler::Provider
|
2
|
-
def
|
2
|
+
def object!(arg_name = nil, &block)
|
3
|
+
srcs, subst_src = if arg_name
|
4
|
+
[block.call(nil), "#{block.parameters[0][1]}=#{arg_name};"]
|
5
|
+
else
|
6
|
+
[block.call, '']
|
7
|
+
end
|
8
|
+
%{"{\#{#{subst_src}[#{srcs.join(',')}].join(',')}}"}
|
9
|
+
end
|
10
|
+
|
11
|
+
def array!(arg_name, &block)
|
3
12
|
item_name = block.parameters[0][1].to_s
|
4
|
-
|
5
|
-
|
6
|
-
|
13
|
+
src = block.call(nil)
|
14
|
+
%{"[\#{#{arg_name}.map { |#{item_name}| #{src} }.join(',')}]"}
|
15
|
+
end
|
16
|
+
|
17
|
+
def integer!(i)
|
18
|
+
%{"#{i}"}
|
7
19
|
end
|
8
20
|
end
|