rexle 1.4.4 → 1.4.5
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/rexle.rb +27 -10
- metadata +17 -17
- 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: 410902164364da60cce5ddec53abfb0e2bb6dd1c
|
4
|
+
data.tar.gz: ccf190e5407656ba73ddd268c4e87bd9dca47e96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9abe85dc8816b16d669721d6bccb6a685bd8afb7cc3ea76fcace91d6bf0175918bb40e68e922225085d8e4cd3f53f6fb81136689003c7264e2a61e906d384c90
|
7
|
+
data.tar.gz: 7698d4111f011f89c78fa75b71d9b72808a44aa977105432e7b17fe9d0c9f2179542ea6c8410b8e0087171798107b6fe71abf26b3a33e94c9ce3f1d34113087b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -11,6 +11,11 @@ require 'backtrack-xpath'
|
|
11
11
|
|
12
12
|
|
13
13
|
# modifications:
|
14
|
+
# 13-Apr-2017: bug fix: Rexle::Elements#index was implemented which fixes the
|
15
|
+
# Rexle::Element#next_sibling and Rexle::Element#previous_sibling bugs
|
16
|
+
# 25-Feb-2017: improvement:
|
17
|
+
# An input rexle array can now have an empty array for
|
18
|
+
# children e.g. doc = Rexle.new(["records", {}, "", []])
|
14
19
|
# 25-Dec-2016: revision for Ruby 2.4: Replaced Fixnum with Integer
|
15
20
|
# 11-Dec-2016: backtrack improvement: The usage of attributes (ID, or class) in the returned XPath is now optional
|
16
21
|
# 11-Nov-2016: bug fix: escaped string using double quotes instead regarding
|
@@ -126,7 +131,7 @@ module XMLhelper
|
|
126
131
|
|
127
132
|
tag = x.name + (a.empty? ? '' : ' ' + a.join(' '))
|
128
133
|
|
129
|
-
non_self_closing_tags = %w(script textarea iframe div)
|
134
|
+
non_self_closing_tags = %w(script textarea iframe div object)
|
130
135
|
|
131
136
|
if (x.children and x.children.length > 0 \
|
132
137
|
and not x.children.is_an_empty_string?) or \
|
@@ -407,10 +412,10 @@ class Rexle
|
|
407
412
|
def next_element()
|
408
413
|
|
409
414
|
id = self.object_id
|
410
|
-
a = self.parent.
|
411
|
-
|
412
|
-
|
413
|
-
a[i] if i < a.length
|
415
|
+
a = self.parent.elements
|
416
|
+
|
417
|
+
i = a.index {|x| x.object_id == id} + 2
|
418
|
+
a[i] if i < a.length + 1
|
414
419
|
|
415
420
|
end
|
416
421
|
|
@@ -426,9 +431,9 @@ class Rexle
|
|
426
431
|
def previous_element()
|
427
432
|
|
428
433
|
id = self.object_id
|
429
|
-
a = self.parent.
|
430
|
-
i = a.index {|x| x.object_id == id}
|
431
|
-
|
434
|
+
a = self.parent.elements
|
435
|
+
i = a.index {|x| x.object_id == id}
|
436
|
+
|
432
437
|
a[i] if i >= 0
|
433
438
|
|
434
439
|
end
|
@@ -1349,6 +1354,16 @@ class Rexle
|
|
1349
1354
|
|
1350
1355
|
def each(&blk) @elements.each(&blk) end
|
1351
1356
|
def empty?() @elements.empty? end
|
1357
|
+
|
1358
|
+
def index(e=nil, &blk)
|
1359
|
+
|
1360
|
+
if block_given? then
|
1361
|
+
@elements.index(&blk)
|
1362
|
+
else
|
1363
|
+
@elements.index e
|
1364
|
+
end
|
1365
|
+
end
|
1366
|
+
|
1352
1367
|
def length() @elements.length end
|
1353
1368
|
def to_a() @elements end
|
1354
1369
|
|
@@ -1500,8 +1515,10 @@ class Rexle
|
|
1500
1515
|
|
1501
1516
|
end
|
1502
1517
|
|
1503
|
-
def scan_element(name, attributes=nil, *children)
|
1504
|
-
|
1518
|
+
def scan_element(name=nil, attributes=nil, *children)
|
1519
|
+
|
1520
|
+
return unless name
|
1521
|
+
|
1505
1522
|
return Rexle::CData.new(children.first) if name == '!['
|
1506
1523
|
return Rexle::Comment.new(children.first) if name == '!-'
|
1507
1524
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE3MDQxMzEwNTAxNFoXDTE4MDQxMzEwNTAxNFowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
ggEBAO/USGxYqMJ9dVxCjmOPcM+SHXQYsBZt1y4tios4tNorTiyy2L3aXubilUIe
|
19
|
+
+9PQ14oMMp3ApZxhXar3D1cgiPYZABHxEkpyM4nQWCfXabOzmLC+K8t3vu3f5eLF
|
20
|
+
F7SLW4T6X2I3EEEj5WtFTin4B9R+O/WABy4ZYHK0pIRsSR+IJZ6kDkwn+KfzBY3Q
|
21
|
+
yM0xMehy/gACXCGJJLarANGP8Z5m2w3KCgBYnw6oMOJpV7YMSS0yW26w5z395Og7
|
22
|
+
4/tbPmTElJDy6oHswaxSzeaQZgaF9Q+ViDlGPTr2EwYFSSch5X8wAVTDkaNZQjFE
|
23
|
+
et7zhqFL8mZdcKYkM7341Ma2b1kCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUplIW9IZtD2UW428kHIbgRAbpjTEwJgYDVR0RBB8w
|
25
25
|
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAUzpUNA/u
|
27
|
+
M9xisDpHZQqtWaFD2oH0siHZfXdD0s6uNXfkxSWkyMgTpKUgpFCgn0Pio8sfjrLI
|
28
|
+
G8+DT6E4uwQwPlhA4OV1csiJZGUy0HN2O0/WaC9kmunngvBd7ErX6s4JB6wcdnoL
|
29
|
+
b1x/IbFTgRyTGQ6+xSYEnzpsTWD2+JJw8FhMmO+6cpuXA1aSPAy5iazWYNZxB7iB
|
30
|
+
0G+K7lT3OyGSyjsNAEIhPbahr4/ne4z3WA+BVDkXhBP6DW5ChcPMCjZq//uQkM/l
|
31
|
+
CqFh6U4iXSHeN7EtB+IaYwj0O7/uQThVBDM+MzSHp5u25hrVs7KrKap0f6rdAVcF
|
32
|
+
1V8kvBbe/enp7g==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-
|
34
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexleparser
|
metadata.gz.sig
CHANGED
Binary file
|