dom_render 0.2.2 → 0.2.3
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.tar.gz.sig +0 -0
- data/lib/dom_render.rb +19 -1
- metadata +2 -2
- 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: 7b47dc68cc997f50c128a0089c1cf9a242f666b6
|
4
|
+
data.tar.gz: 044f66c0048d94a9f036307781358532fa155bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 257f404542e8bb05dfdd5e19390064f09f51a794bcd4b223cb5b4cedfc6f501a0047e95d6859fa30e55cb9698b84665c480416528aba761e8e14af0da34e458a
|
7
|
+
data.tar.gz: 0b63f32ee3c28b86c790ae15eba6d1dcb794a5ac2c7dd9101d94e245232477c112b33d1e00a46d9bc0f4466c00547d1d2e0908f720a4ca663fc1a6d71bb985fc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dom_render.rb
CHANGED
@@ -62,4 +62,22 @@ class DomRender
|
|
62
62
|
|
63
63
|
end
|
64
64
|
|
65
|
-
|
65
|
+
# expands a CSS shorthand for a margin or padding property
|
66
|
+
# e.g. "1em 1.5em" #=> ['1em','1.5em','1em','1.5em']
|
67
|
+
#
|
68
|
+
def expand_shorthand(s)
|
69
|
+
|
70
|
+
a = s.scan(/\d+(?:\.\d+)?\s*(?:em|px)?/)
|
71
|
+
|
72
|
+
case a.length
|
73
|
+
when 1 then [a[0]] * 4
|
74
|
+
when 2 then [a[0],a[-1],a[0],a[-1]]
|
75
|
+
when 4 then a
|
76
|
+
else
|
77
|
+
(a + [0,0,0,0]).take 4
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dom_render
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
ipCgMpSHSTGoxQ/dI853bcb+vPkAqS69GEcZgtvAmCQs5E4KC1seYLuP3qtuatL9
|
32
32
|
dbkCMOVMy0htMQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-11-
|
34
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|