csslite 0.1.2 → 0.1.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/csslite.rb +15 -3
- 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: 7fb82c1cfd6d8794f652310cfb81ab840e513644
|
4
|
+
data.tar.gz: 15ff90c9f4011b68b2b4051e5b12f05023d3aaa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3621c4f457fb16582d4b9556eea03d1a0009b86f6f407c4efe8769959093510d9b277890f91867d86b9b151679ee500fb66758f765ea9ef127019c3a43e2426b
|
7
|
+
data.tar.gz: e836886bb33ebd1ce7c2b12c42cce3e1e8801c92101d895e46faa297ef8f044b27517016fd0262c6d4a43814ebc38905e0d81ec9fd2c470678040f01d169e629
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/csslite.rb
CHANGED
@@ -41,9 +41,10 @@ class CSSLite
|
|
41
41
|
|
42
42
|
root_element.css(selector).each do |element|
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
apply_style element, k, v
|
45
|
+
|
46
|
+
# apply the CSS to all its children
|
47
|
+
element.each_recursive {|x| apply_style x, k,v}
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
@@ -51,5 +52,16 @@ class CSSLite
|
|
51
52
|
end
|
52
53
|
|
53
54
|
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
|
59
|
+
def apply_style(e, k, v)
|
60
|
+
|
61
|
+
id = e.object_id
|
62
|
+
@elements[id] = e.style.to_h unless @elements.has_key? id
|
63
|
+
e.style[k] = v unless @elements[id].has_key? k
|
64
|
+
|
65
|
+
end
|
54
66
|
|
55
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csslite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
9gIs6nm8KnBHUmzrn9afy/5KR51QuJ9cQmRMA+Dwkp8jTv1PhX51X58V2yt4eEYg
|
32
32
|
oKq4EGm16laTPw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-09-
|
34
|
+
date: 2017-09-10 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@jamesrobertson.eu
|
metadata.gz.sig
CHANGED
Binary file
|