rexle 1.3.24 → 1.3.26
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 +12 -7
- metadata +1 -1
- 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: 7da47f8001a64e9aceee1d162829c66ec3334c57
|
4
|
+
data.tar.gz: a9f17ccda8b13401b56198dac0c6c8bf3abca4ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f83eecbb739ee7ec616145f2f26982c9f02fa03ce98c4b001e0f09474cfa77726b98fc0961466f16ec01a1f09d0c3d05136162ecbe8532b38e51aef40696b22
|
7
|
+
data.tar.gz: 6c228aec57852e66e76e8fa40cff9cb6fd56606f7fba06130d9e20221192a5848d9ea51b66fb43d04328a2305d3b25500344ad6d3a3e4f1160862c67437a2df5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -12,6 +12,8 @@ require 'backtrack-xpath'
|
|
12
12
|
|
13
13
|
# modifications:
|
14
14
|
|
15
|
+
# 22-Apr-2016: revision: The previous feature can now include simple
|
16
|
+
# predicate logic e.g. 2 < 5
|
15
17
|
# 22-Apr-2016: feature: Using an XPath A pure logic predicate can now be
|
16
18
|
# processed e.g. (4 % 1) != 1
|
17
19
|
# 21-Apr-2016: feature: The xpath() method now returns a Rexle::Recordset object
|
@@ -579,15 +581,19 @@ class Rexle
|
|
579
581
|
# isolate the xpath to return just the path to the current element
|
580
582
|
|
581
583
|
elmnt_path = s[/^([a-zA-Z:\-\*]+\[[^\]]+\])|[\/]+{,2}[^\/]+/]
|
582
|
-
|
583
584
|
element_part = elmnt_path[/(^@?[^\[]+)?/,1] if elmnt_path
|
584
585
|
|
585
586
|
if element_part then
|
586
587
|
|
587
|
-
unless element_part[/^(@|[
|
588
|
+
unless element_part[/^(@|[@\.a-zA-Z]+[\s=])/] then
|
589
|
+
|
588
590
|
element_name = element_part[/^[\w:\-\*\.]+/]
|
591
|
+
|
592
|
+
if element_name and element_name[/^\d/] then
|
593
|
+
element_name = nil
|
594
|
+
end
|
589
595
|
|
590
|
-
condition = raw_xpath_value
|
596
|
+
condition = raw_xpath_value if element_name.nil?
|
591
597
|
|
592
598
|
else
|
593
599
|
if xpath_value[/^\[/] then
|
@@ -595,7 +601,6 @@ class Rexle
|
|
595
601
|
element_name = nil
|
596
602
|
else
|
597
603
|
condition = element_part
|
598
|
-
|
599
604
|
attr_search = format_condition('[' + condition + ']')
|
600
605
|
#@log.debug 'attr_search : ' + attr_search.inspect
|
601
606
|
return [attribute_search(attr_search, \
|
@@ -605,7 +610,7 @@ class Rexle
|
|
605
610
|
end
|
606
611
|
|
607
612
|
end
|
608
|
-
|
613
|
+
|
609
614
|
#element_name ||= '*'
|
610
615
|
raw_condition = '' if condition
|
611
616
|
|
@@ -1021,9 +1026,9 @@ class Rexle
|
|
1021
1026
|
|
1022
1027
|
def format_condition(condition)
|
1023
1028
|
|
1024
|
-
raw_items = condition[1
|
1029
|
+
raw_items = condition.sub(/\[(.*)\]/,'\1').scan(/\'[^\']*\'|\"[^\"]*\"|\
|
1025
1030
|
and|or|\d+|[!=<>%]+|position\(\)|contains\([^\)]+\)|notx\([^\)]+\)|[@\w\.\/&;]+/)
|
1026
|
-
|
1031
|
+
|
1027
1032
|
if raw_items[0][/^\d+$/] then
|
1028
1033
|
|
1029
1034
|
if condition[0 ] == '[' then
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|