jcompiler 0.1.38 → 0.1.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jcompiler.rb +6 -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: 32b6cede5b722b3990c0ecd47631b8d04a732d21
|
4
|
+
data.tar.gz: 4606729e5b28c75244ad288662b52b17e22f2517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 121c67a3ab3a04bc5d2e3d8d955be29ffc4a50f07e25b1d05c05ae9bc2cf0696960fce4ddb4bafffc7cc66fa3f15c55b3184484d887a1a295015e2bdc20c9e75
|
7
|
+
data.tar.gz: 6d345921282de0e8d915404317188c085f6b464da9a79a8c2e551aba053248ba806c8ae5dabed9155c8fad1059ffa5bceda6f8ba369394675ccfc8d820b8c507
|
data/lib/jcompiler.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Jcompiler
|
2
|
-
def
|
2
|
+
def b(brand, bind)
|
3
3
|
bind.local_variable_set(:brand, brand)
|
4
4
|
{
|
5
5
|
id: 'brand.id',
|
@@ -18,13 +18,13 @@ class Jcompiler
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def a(brands, bind)
|
22
22
|
brands.map do |brand|
|
23
23
|
"{#{b(brand, bind).join(',')}}"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
27
|
+
def code(brands, bind)
|
28
28
|
bind.local_variable_set(:brands, brands)
|
29
29
|
"[#{a(brands, bind).join(',')}]"
|
30
30
|
end
|
@@ -34,8 +34,10 @@ class JcompilerHandler
|
|
34
34
|
cattr_accessor :default_format
|
35
35
|
self.default_format = Mime::JSON
|
36
36
|
|
37
|
+
@@jcompiler = Jcompiler.new
|
38
|
+
|
37
39
|
def self.call(template)
|
38
|
-
"
|
40
|
+
"@@jcompiler.code(@brands, binding)"
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|