jcompiler 0.1.109 → 0.1.110
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/initialize.rb +2 -0
- data/lib/jcompiler/provider.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f02bf1cd33e4ac4ab9bbfac7d22c0bd2b711656a
|
4
|
+
data.tar.gz: 99f381256fd52a2bdd39cc61aeb8b044d39a354b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6270a9b7ab02ccf6272ef664839eae2de47846944439d058fbda26d6005f242b0970c6a98696092cad499d2602a4ab6c9cf3fe48374b63b50967e44dad7c87d
|
7
|
+
data.tar.gz: 7802c7ea92b1a9fc6275c02868950563dfc37274b3f2f22ca8e9d2cdd708aa3895a9d5815203b8a220800a425a24b3e4d040afd86bcbf57b7179c5e2a539b024
|
data/build
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
111
|
data/lib/initialize.rb
CHANGED
data/lib/jcompiler/provider.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
class Jcompiler::Provider
|
2
|
+
def initialize
|
3
|
+
@context = nil
|
4
|
+
end
|
5
|
+
|
2
6
|
def object!(arg_name = nil, &block)
|
7
|
+
pre_context = context
|
8
|
+
context = []
|
3
9
|
srcs, subst_src = if arg_name
|
4
10
|
[block.call(nil), "#{block.parameters[0][1]}=#{arg_name};"]
|
5
11
|
else
|
6
12
|
[block.call, '']
|
7
13
|
end
|
14
|
+
context = pre_context
|
8
15
|
%{"{\#{#{subst_src}[#{srcs.join(',')}].join(',')}}"}
|
9
16
|
end
|
10
17
|
|
@@ -17,4 +24,12 @@ class Jcompiler::Provider
|
|
17
24
|
def integer!(i)
|
18
25
|
%{"#{i}"}
|
19
26
|
end
|
27
|
+
|
28
|
+
def method_missing(name, *args, &block)
|
29
|
+
context << %{"\\"#{name}\\":3"}
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
attr_accessor :context
|
20
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jcompiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.110
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsuri Moriya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: High performance JSON view via compiled DSL
|
14
14
|
email:
|