rexle 1.4.9 → 1.4.10

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
  SHA1:
3
- metadata.gz: 98f19567413d343fb79d1c7e52f86fdc9dbdc88b
4
- data.tar.gz: bafcdc98a8e5b68a6c62bfdee0848c207fd76e54
3
+ metadata.gz: bb551e9cf6a92e8f75ac9067fad4c2afaf5f7dd9
4
+ data.tar.gz: 5e73ba3a1bae02aa5ce2385d43d4dd6bf131f3c8
5
5
  SHA512:
6
- metadata.gz: b37416cc559780e556e9a1c7d84b9b9a4a5c27ee8fb617e4c92ad875fd78f74ca9b3b99b9cae272546e0b804bf6cd9433b3337fd292d9ae594c870277bdc330f
7
- data.tar.gz: a2723ec9c0a4916c17d42ceb614461ca10239b9a029cb951c74a477311c26eef21518d2877e45ef415f0d504b14c57a88ad63aecf64fbe2e6f1dc865cffe280c
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 [true] if !path[/[><]/] and raw_results.flatten.index(true)
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.9
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-14 00:00:00.000000000 Z
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