domle 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/domle.rb +21 -8
- 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: ffedd3974a12290417326278c4df2f79c97e64303eec8e5c4fa3e3875b4d2663
|
4
|
+
data.tar.gz: b2be643717e9f483a671c57e2fde3ec2c423cdc25d5c905a6fc594a17ec00853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cdf45a19fbf66d9a57cb563fb9db01f3a874b748530e1f94343c8ec6202dc3b9b5b85d6bc19e45d0012a859a928de9567aa41a12f84e69bdce0245cb3b264fa
|
7
|
+
data.tar.gz: 12fb235afb980a62648b90b98cdef319deedf2036b903de80a882bef333a556e6cb3823e8e60d00b6f78934572af957e5ddcba7d98c358bef000bd9046d7d623
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/domle.rb
CHANGED
@@ -54,6 +54,7 @@ class VisualAttributes < Attributes
|
|
54
54
|
end
|
55
55
|
|
56
56
|
class Domle < Rexle
|
57
|
+
using ColouredText
|
57
58
|
|
58
59
|
class Element < Rexle::Element
|
59
60
|
|
@@ -66,16 +67,17 @@ class Domle < Rexle
|
|
66
67
|
|
67
68
|
def toggle(name)
|
68
69
|
@a.include?(name) ? @a.delete(name) : @a << name
|
69
|
-
puts '@rexle?: ' + @rexle.inspect
|
70
|
+
puts '@rexle?: ' + @rexle.inspect if @debug
|
70
71
|
@rexle.refresh_css(@node) if @rexle
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
74
75
|
@default = {}
|
75
76
|
@attr_map = {}
|
77
|
+
attr_reader :attr_map
|
76
78
|
|
77
79
|
def initialize(name=self.class.to_s.downcase[/\w+$/], value: nil, \
|
78
|
-
attributes:
|
80
|
+
attributes: {}, rexle: nil)
|
79
81
|
|
80
82
|
attributes.merge!(style: '') unless attributes.has_key? :style
|
81
83
|
super(name, value: value, attributes: VisualAttributes.new(attributes), rexle: rexle)
|
@@ -153,10 +155,22 @@ class Domle < Rexle
|
|
153
155
|
end
|
154
156
|
end
|
155
157
|
|
158
|
+
def obj=(v)
|
159
|
+
@obj = v
|
160
|
+
end
|
161
|
+
|
162
|
+
def obj()
|
163
|
+
@obj
|
164
|
+
end
|
165
|
+
|
166
|
+
|
156
167
|
private
|
157
168
|
|
158
169
|
def attr_update(name, val)
|
159
|
-
|
170
|
+
return unless @attr_map
|
171
|
+
puts 'inside attr_update, @attr_map: ' + @attr_map.inspect if @debug
|
172
|
+
name = (@attr_map[name].to_s + '=').to_sym
|
173
|
+
@obj.method(name).call(val) if @obj.respond_to? name
|
160
174
|
end
|
161
175
|
end
|
162
176
|
|
@@ -176,10 +190,9 @@ class Domle < Rexle
|
|
176
190
|
@callback, @debug, @rexle = callback, debug, rexle
|
177
191
|
puts 'inside Domle initialize'.info if @debug
|
178
192
|
puts 'src:' + src.inspect if @debug
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
@debug = debug = true
|
193
|
+
|
194
|
+
super(RXFHelper.read(src).first, rexle: self)
|
195
|
+
@debug = debug
|
183
196
|
|
184
197
|
puts 'before find add_css' if @debug
|
185
198
|
find_add_css() if src
|
@@ -270,7 +283,7 @@ class Domle < Rexle
|
|
270
283
|
puts 'add_css s: ' + s.inspect if @debug
|
271
284
|
css = CSSLite.new s, debug: @debug
|
272
285
|
node ||= @doc
|
273
|
-
puts 'before propagate node: ' + node.inspect
|
286
|
+
puts 'before propagate node: ' + node.inspect if @debug
|
274
287
|
css.propagate node
|
275
288
|
puts node.xml if @debug
|
276
289
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ewt0cFO7UqEB/yC8KNeXJjd19INo+w98LYjFZQEzLAg15Sz7ca5bUbr/LuYQUk4y
|
36
36
|
Lvi3w1KUp4YuUbhbhnEQXuPH
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-
|
38
|
+
date: 2020-06-07 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|