rexle 1.4.9 → 1.4.10
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/rexle.rb +16 -3
- metadata +2 -2
- 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: bb551e9cf6a92e8f75ac9067fad4c2afaf5f7dd9
|
4
|
+
data.tar.gz: 5e73ba3a1bae02aa5ce2385d43d4dd6bf131f3c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cd6f197d50eb6a4f8c9e5f5813b718daef95691d4e3ecd76673a0b3df73483f4fb1a5b8ac4bbf3609757c3e97338fca2810f5c83444197354d99bf5db403026
|
7
|
+
data.tar.gz: ce54a10d2f5371009657ace6951f2504a58ad12a7a02ead2077b1cdcd3a1fd9dd0f16199fa90dfa13e58be3224469289be200b1a247f8d3e0a0441fdd8dc548b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -11,6 +11,8 @@ require 'backtrack-xpath'
|
|
11
11
|
|
12
12
|
|
13
13
|
# modifications:
|
14
|
+
# 16-Sep-2017: improvement: Multiple results are now returned if the
|
15
|
+
# xpath contains an *and* operator
|
14
16
|
# 14-Sep-2017: improvement: An *and* operator can now be
|
15
17
|
# used between xpath statements
|
16
18
|
# 10-Sep-2017: bug fix: The following XPath has now been tested => //.[@id]
|
@@ -528,18 +530,29 @@ class Rexle
|
|
528
530
|
}
|
529
531
|
bucket = []
|
530
532
|
|
531
|
-
if path =~ /[\[]|\(/ then
|
533
|
+
results = if path =~ /[\[]|\(/ then
|
532
534
|
|
533
535
|
raw_results = path.split(/\|/).map do |xp|
|
534
536
|
query_xpath(xp.strip, bucket, &blk)
|
535
537
|
end
|
538
|
+
|
539
|
+
raw_results.flatten.index(true) ? [true] : []
|
540
|
+
|
536
541
|
else
|
537
542
|
raw_results = path.split(/ *(?:\||\band\b) */).map do |xp|
|
538
543
|
query_xpath(xp.strip, bucket, &blk)
|
539
544
|
end
|
545
|
+
|
546
|
+
if path =~ / and / then
|
547
|
+
|
548
|
+
raw_results.flatten.select {|x| x == true or x == false}
|
549
|
+
|
550
|
+
else
|
551
|
+
raw_results.flatten.index(true) ? [true] : []
|
552
|
+
end
|
540
553
|
end
|
541
|
-
|
542
|
-
return
|
554
|
+
|
555
|
+
return results if !path[/[><]/] and results.any?
|
543
556
|
results = raw_results # .flatten.select {|x| x}
|
544
557
|
|
545
558
|
procs[results.class.to_s.to_sym].call(results) if results
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
CqFh6U4iXSHeN7EtB+IaYwj0O7/uQThVBDM+MzSHp5u25hrVs7KrKap0f6rdAVcF
|
32
32
|
1V8kvBbe/enp7g==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-09-
|
34
|
+
date: 2017-09-16 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexleparser
|
metadata.gz.sig
CHANGED
Binary file
|