jcompiler 0.1.108 → 0.1.109

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/build +1 -1
  3. data/lib/jcompiler/provider.rb +16 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d0afc21ed51d049338587294fd44626505fd410
4
- data.tar.gz: ea9994aef1f75b92c7a774bd2ffcb392261eb240
3
+ metadata.gz: d2ec0564fadc4684c4b0cafc2b4dd894c9de3a25
4
+ data.tar.gz: 205036178218fa9ec453238d678024a1b806b50b
5
5
  SHA512:
6
- metadata.gz: ad688cdd7525f7fa1fe06e80b8b196d5f1af5dec404caf91060bb7e7c6988b3e364c301e23e0aa8658e0595ddce84cdf23166bb5b0dd66da5fa08f826cff5bed
7
- data.tar.gz: 0fcfd73803125ffded02ef117cce268c98296dfdb8f8488bd97af3a42e314a2ea02105a4bd1ab6621aecd51b93299c71aac8fc7d4120a8f6272615f03d0d5785
6
+ metadata.gz: 8b34fa53bf48af5be36d6267748d4eb1a1cb33c98ef76c965da7d75ef4db5fb9a61f2688fc6e060d16b4f926e04a5792e653b35b3fc583bf120583f949a16691
7
+ data.tar.gz: cdbce9e6fda20db5b6e53a0832b27afd33ad79adb5a12ee37acdd24d5065be48f03b22d5aabe0765c5302fb5a465ef9615b60068405f9992e719cd0a5da7bdec
data/build CHANGED
@@ -1 +1 @@
1
- 109
1
+ 110
@@ -1,8 +1,20 @@
1
1
  class Jcompiler::Provider
2
- def array!(arr, &block)
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
- #src = block.call(item_name)
5
- #'"[#{eval(arr.to_s)}]"'
6
- %{"[\#{#{arr}.map { |#{item_name}| brand.id }.join(',')}]"}
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jcompiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.108
4
+ version: 0.1.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsuri Moriya