jcompiler 0.1.112 → 0.1.113
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 +5 -7
- 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: 6c388f9fe5b925c85ddabdfbf40c82a6d3a55826
|
4
|
+
data.tar.gz: 59955188fa77c115e29794da2e9920a0faf45eca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bbdd9332ba6dfa273dc62c6df0d2dfee5dbdf5389a0da401d5896e6013ac97d6c0d03d048b4b94fe27dbe308e55420fa15d6ff24808f0f0b24abdceed62d950
|
7
|
+
data.tar.gz: 76906856d1781be7eb8c16690815931cd2ec60d62fdd8592713649402c752137fa4a4ec22090708e738a8116c4221c8cb99e15205551f9e5b633ca74ed5f5402
|
data/build
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
114
|
data/lib/jcompiler/provider.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
class Jcompiler::Provider
|
2
|
+
attr_accessor :context
|
3
|
+
|
2
4
|
def initialize
|
3
5
|
@context = nil
|
4
6
|
end
|
5
7
|
|
6
8
|
def object!(arg_name = nil, &block)
|
7
9
|
pre_context = @context
|
8
|
-
|
10
|
+
context = []
|
9
11
|
srcs, subst_src = if arg_name
|
10
12
|
[block.call(nil), "#{block.parameters[0][1]}=#{arg_name};"]
|
11
13
|
else
|
12
14
|
[block.call, '']
|
13
15
|
end
|
14
|
-
|
16
|
+
context = pre_context
|
15
17
|
%{"{\#{#{subst_src}[#{srcs.join(',')}].join(',')}}"}
|
16
18
|
end
|
17
19
|
|
@@ -26,10 +28,6 @@ class Jcompiler::Provider
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def method_missing(name, *args, &block)
|
29
|
-
|
31
|
+
context << %{"\\"#{name}\\":3"}
|
30
32
|
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
attr_accessor :context
|
35
33
|
end
|