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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23ee4f1fbc6c7aed763a4bc53742b7aa32d1a40bb2986bd00e600ecccb07da77
4
- data.tar.gz: 5179cff8f4018365562a21860e7bbff942fd99bf0176409706ce1c6c4f3dc5a5
3
+ metadata.gz: 1f39fbcfa25499d971f6bfa2a78d1477e3506d6a03fad4b3dde3c1c2328b355a
4
+ data.tar.gz: 13947e8947824eb4d444e3909c2787da3417004ab3e1f479ab7eb7ca7d54c66b
5
5
  SHA512:
6
- metadata.gz: 572d484cb1170d6a9f22268f4288bec3f9566db02fcff79b2a58e93e5d84cf2818d132b50f339be65132b189c6cb84b62b7255a4a5e8319dc77cd728163c5dd1
7
- data.tar.gz: d5456ebc4697652d3af9ca69f9662afa13382ce6bed9483ddbf2b495f8f5ce09a98c0d11c26b3f93f3808b7c1fadcd97adcce57f4e993a7e7691ede6c88afbec
6
+ metadata.gz: a72f44a0ba3a3ee12a0b9e770b3f448d9885d40b120570f44aeee46f935dcb8d3aa0f6ef10823d180b53df790349d7dd96091ec954c74ca4aed1986e4fe6ec2e
7
+ data.tar.gz: f59962deb23ed6bb0e1f1da513ba6e19e65db8677f4d531780cddc69f45f226e92839a7205a783430eb985d13da3eb60ecd320d7767c0296373512a07990633e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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!(new_h) : h = new_h.merge(h)
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] = h.map{|x| x.join(':') }.join(';')
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.1.4
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-11 00:00:00.000000000 Z
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