jcompiler 0.1.47 → 0.1.48
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.rb +0 -40
- 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: 98fb8e912cea03c52c6641b9a7d59c6fd4506707
|
4
|
+
data.tar.gz: a3d6cc1bbf4b24a3e76899f00444609b002ec93d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 606a72e91bba55508912145099d98b46077fad012a988f84d53a8524ea45595e86bd440fb234872d48fdad1a200a3e5c91693187fd7c18b0e0fbbb1bfbf91253
|
7
|
+
data.tar.gz: ccae0d33c4b0509833497b62bf08adfa7c6b7957c4ba71a559492334367f078c3a8acd4fdbad24a4f2effba06d83f3371041058f64f8890490d093a61e18b626
|
data/build
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
49
|
data/lib/jcompiler.rb
CHANGED
@@ -1,42 +1,2 @@
|
|
1
1
|
class Jcompiler
|
2
|
-
@@codes = {}
|
3
|
-
|
4
|
-
private
|
5
|
-
|
6
|
-
attr_accessor :ids
|
7
|
-
|
8
|
-
def b(brand, bind)
|
9
|
-
bind.local_variable_set(:brand, brand)
|
10
|
-
{
|
11
|
-
id: 'brand.id',
|
12
|
-
name: 'brand.name',
|
13
|
-
description: 'brand.description',
|
14
|
-
published_at: 'brand.published_at.utc.iso8601(3)',
|
15
|
-
official_url: 'brand.blog_url',
|
16
|
-
sex_group: 'brand.blog_sex_switch',
|
17
|
-
image_medium: 'absolute_url(brand.image_file.url(:medium))',
|
18
|
-
image_square: 'absolute_url(brand.image_file.url(:square))',
|
19
|
-
url: 'brand_path(brand)',
|
20
|
-
labels: 'brand.new_arrival? ? \'["NEW"]\' : \'[]\''
|
21
|
-
}.map do |key, code|
|
22
|
-
v = eval(code, bind)
|
23
|
-
"\"#{key}\":#{v.is_a?(String) ? ActiveSupport::JSON.encode(v) : v ? v.to_s : 'null'}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def a(brands, bind)
|
28
|
-
brands.map do |brand|
|
29
|
-
"{#{b(brand, bind).join(',')}}"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.code(id, source, bind)
|
34
|
-
if @@codes.has_key?(id)
|
35
|
-
@@codes[id] ||=
|
36
|
-
else
|
37
|
-
|
38
|
-
end
|
39
|
-
debugger
|
40
|
-
1
|
41
|
-
end
|
42
2
|
end
|