domle 0.5.0 → 0.5.1

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: 4aae0c6c1cf14054879f710475a65bd756a849f30d2c4b220d6974f5d6b2d702
4
- data.tar.gz: b32f5ea3a8ec6af2f9c86f0027233b7ceb3ae6f61dcd38db9dd8be60edb4035b
3
+ metadata.gz: ffedd3974a12290417326278c4df2f79c97e64303eec8e5c4fa3e3875b4d2663
4
+ data.tar.gz: b2be643717e9f483a671c57e2fde3ec2c423cdc25d5c905a6fc594a17ec00853
5
5
  SHA512:
6
- metadata.gz: b699d13d11215c3f48cb7c24355ef17ad7e2bb110a7a05137504674c20028e8641e9a4065aefa4a8da051bd6980121b9d0a78abbe5184ea53cb4c4f17da0732f
7
- data.tar.gz: 0af2dcf1fa3138453a3fc5e5c91e26b6ff33ebc113e6788a301fa936f702cef0c14324013f8efa75dfc2f9e2d74780c32a629709409821327ef6c133598b51ff
6
+ metadata.gz: 0cdf45a19fbf66d9a57cb563fb9db01f3a874b748530e1f94343c8ec6202dc3b9b5b85d6bc19e45d0012a859a928de9567aa41a12f84e69bdce0245cb3b264fa
7
+ data.tar.gz: 12fb235afb980a62648b90b98cdef319deedf2036b903de80a882bef333a556e6cb3823e8e60d00b6f78934572af957e5ddcba7d98c358bef000bd9046d7d623
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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: VisualAttributes.new(parent: self), rexle: nil)
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
- @debug = debug = false
181
- super(RXFHelper.read(src).first, rexle: self, debug: debug)
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.0
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-05-12 00:00:00.000000000 Z
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