jcompiler 0.1.113 → 0.1.114

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 -7
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c388f9fe5b925c85ddabdfbf40c82a6d3a55826
4
- data.tar.gz: 59955188fa77c115e29794da2e9920a0faf45eca
3
+ metadata.gz: dec545154ef13d050e035f63efb96c2da13eb4e6
4
+ data.tar.gz: 8bc2db59420fe90452fdcd41f844791ca21e6f48
5
5
  SHA512:
6
- metadata.gz: 2bbdd9332ba6dfa273dc62c6df0d2dfee5dbdf5389a0da401d5896e6013ac97d6c0d03d048b4b94fe27dbe308e55420fa15d6ff24808f0f0b24abdceed62d950
7
- data.tar.gz: 76906856d1781be7eb8c16690815931cd2ec60d62fdd8592713649402c752137fa4a4ec22090708e738a8116c4221c8cb99e15205551f9e5b633ca74ed5f5402
6
+ metadata.gz: f67e39b6daeb22595645b344b13c73b7d6b8067e0ad41f383e8582bc27e71bc28621a18dc7b25c85734c344c47c2bcc46ff81e712a5d0ed25985a51e3c97e7d7
7
+ data.tar.gz: 98b161e420fa2f9a7f075b77de2feb396a3b258d27f59879ed21f64b42e5cd2f8101a69ff5b7fb61d5fa9f2081f545670d9bf937492137b7a9abb3e639c7d22b
data/build CHANGED
@@ -1 +1 @@
1
- 114
1
+ 115
@@ -1,19 +1,17 @@
1
1
  class Jcompiler::Provider
2
- attr_accessor :context
3
-
4
2
  def initialize
5
3
  @context = nil
6
4
  end
7
5
 
8
6
  def object!(arg_name = nil, &block)
9
7
  pre_context = @context
10
- context = []
8
+ @context = []
11
9
  srcs, subst_src = if arg_name
12
10
  [block.call(nil), "#{block.parameters[0][1]}=#{arg_name};"]
13
11
  else
14
12
  [block.call, '']
15
13
  end
16
- context = pre_context
14
+ @context = pre_context
17
15
  %{"{\#{#{subst_src}[#{srcs.join(',')}].join(',')}}"}
18
16
  end
19
17
 
@@ -23,11 +21,22 @@ class Jcompiler::Provider
23
21
  %{"[\#{#{arg_name}.map { |#{item_name}| #{src} }.join(',')}]"}
24
22
  end
25
23
 
26
- def integer!(i)
27
- %{"#{i}"}
24
+ def number!(num)
25
+ %{"#{num}"}
28
26
  end
29
27
 
30
28
  def method_missing(name, *args, &block)
31
- context << %{"\\"#{name}\\":3"}
29
+ src = if block
30
+ block.call
31
+ else
32
+ args[0]
33
+ end
34
+ @context << %{"\\"#{name}\\":\#{#{src}}"}
35
+ end
36
+
37
+ protected
38
+
39
+ def value!
40
+
32
41
  end
33
42
  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.113
4
+ version: 0.1.114
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsuri Moriya