csslite 0.1.4 → 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.tar.gz.sig +0 -0
- data/lib/csslite.rb +13 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f39fbcfa25499d971f6bfa2a78d1477e3506d6a03fad4b3dde3c1c2328b355a
|
4
|
+
data.tar.gz: 13947e8947824eb4d444e3909c2787da3417004ab3e1f479ab7eb7ca7d54c66b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a72f44a0ba3a3ee12a0b9e770b3f448d9885d40b120570f44aeee46f935dcb8d3aa0f6ef10823d180b53df790349d7dd96091ec954c74ca4aed1986e4fe6ec2e
|
7
|
+
data.tar.gz: f59962deb23ed6bb0e1f1da513ba6e19e65db8677f4d531780cddc69f45f226e92839a7205a783430eb985d13da3eb60ecd320d7767c0296373512a07990633e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/csslite.rb
CHANGED
@@ -43,6 +43,7 @@ class CSSLite
|
|
43
43
|
|
44
44
|
selectors.each do |selector|
|
45
45
|
|
46
|
+
puts 'root_element: ' + root_element.inspect if @debug
|
46
47
|
root_element.css(selector).each do |element|
|
47
48
|
puts 'element: ' + element.inspect if @debug
|
48
49
|
apply_style element, style
|
@@ -64,10 +65,20 @@ class CSSLite
|
|
64
65
|
puts 'h: ' + h.inspect if @debug
|
65
66
|
|
66
67
|
puts 'new_h: ' + new_h.inspect if @debug
|
67
|
-
@override ? h.merge
|
68
|
+
h2 = @override ? h.merge(new_h) : new_h.merge(h)
|
68
69
|
|
69
70
|
puts 'after h: ' + h.inspect if @debug
|
70
|
-
e.attributes[:style] =
|
71
|
+
e.attributes[:style] = h2.map{|x| x.join(':') }.join(';')
|
72
|
+
|
73
|
+
a = (h2 .to_a - e.style.to_h.to_a )
|
74
|
+
puts 'a: ' + a.inspect if @debug
|
75
|
+
|
76
|
+
a.each do |key, value|
|
77
|
+
name = (key.to_s + '=').to_sym
|
78
|
+
puts 'name: ' + name.inspect if @debug
|
79
|
+
puts 'value: ' + value.inspect if @debug
|
80
|
+
e.method(name).call(value) if e.respond_to? name
|
81
|
+
end
|
71
82
|
|
72
83
|
end
|
73
84
|
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
T2RwjhAnWqdUfU1ddLSGXfvZc5losV0GOxqUDXg1chnBLh6mm5IkSTp+PZaT3H7d
|
36
36
|
KosATF+mCCLwHG4CZS33JUkx
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-05-
|
38
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
39
39
|
dependencies: []
|
40
40
|
description:
|
41
41
|
email: james@jamesrobertson.eu
|
metadata.gz.sig
CHANGED
Binary file
|