dom_render 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/dom_render.rb +17 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af7363d5b0fed8a3422d4c3c960c1a16a49431c7
|
4
|
+
data.tar.gz: be6d502ff08c532aeb655d75b58a967fd7d0757a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ddf3c0349a5d0b7a6e4f4bcc9e60e9e402ee11f08cc06164a0e74798ace7d72405d3dd42f730d35a2fe3ae5b5503ebc38edfa6ec6682ce33c4c75e8606c356
|
7
|
+
data.tar.gz: 088482413e5831bd90bd2dfb2c9aa939f1b5286a6ddcaabe8b42d31412bf2a516e6a313b1ad183d16e8aefafd5928df3ce7853af8f09b694623056a23c3c5313
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dom_render.rb
CHANGED
@@ -15,7 +15,11 @@ class DomRender
|
|
15
15
|
|
16
16
|
def render(x)
|
17
17
|
|
18
|
-
|
18
|
+
style = fetch_style(x.attributes) if x.attributes.has_key? :style
|
19
|
+
args = [x]
|
20
|
+
args.concat([x.attributes, style])
|
21
|
+
|
22
|
+
r = method(x.name.to_sym).call(*args)
|
19
23
|
|
20
24
|
if r.last.empty? then
|
21
25
|
r[0..-2]
|
@@ -39,4 +43,16 @@ class DomRender
|
|
39
43
|
end
|
40
44
|
|
41
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def fetch_style(attributes={})
|
50
|
+
|
51
|
+
attributes[:style].split(';').inject({}) do |r, x|
|
52
|
+
k, v = x.split(':',2)
|
53
|
+
r.merge(k.to_sym => v)
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
42
58
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|