rexle 1.3.26 → 1.3.27
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 +38 -4
- 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: cc9061e7f94d1f11a1eba7340e7a5452b00649f4
|
4
|
+
data.tar.gz: 036c63375a1cae28f1042e4bb786417ce03f0c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f3b082e70777e6b98bedbae24ca2765f33d308844494e9300779bef608bbda21448e3ea3e650793179a630ab2235bd84c40d0c92afe1620210d8e241abce364
|
7
|
+
data.tar.gz: 5f2f0abd467f33f49d438358bc1779f41df73bb954e0812b3719af8e10489ea2f2585fe1b82aa227d5f2c5a060d3c3670fbbfb1ed940003fa8a61782f4f1d9ac
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -12,7 +12,9 @@ require 'backtrack-xpath'
|
|
12
12
|
|
13
13
|
# modifications:
|
14
14
|
|
15
|
-
#
|
15
|
+
# 23-Apr-2016: xpath improvement: Better predicate support
|
16
|
+
# e.g. e.xpath("node != ''")
|
17
|
+
# revision: The previous feature can now include simple
|
16
18
|
# predicate logic e.g. 2 < 5
|
17
19
|
# 22-Apr-2016: feature: Using an XPath A pure logic predicate can now be
|
18
20
|
# processed e.g. (4 % 1) != 1
|
@@ -596,6 +598,7 @@ class Rexle
|
|
596
598
|
condition = raw_xpath_value if element_name.nil?
|
597
599
|
|
598
600
|
else
|
601
|
+
|
599
602
|
if xpath_value[/^\[/] then
|
600
603
|
condition = xpath_value
|
601
604
|
element_name = nil
|
@@ -627,6 +630,8 @@ class Rexle
|
|
627
630
|
|
628
631
|
|
629
632
|
return_elements = []
|
633
|
+
|
634
|
+
|
630
635
|
|
631
636
|
if raw_path[0,2] == '//' then
|
632
637
|
|
@@ -667,15 +672,44 @@ class Rexle
|
|
667
672
|
elsif element_name.nil?
|
668
673
|
return eval attr_search
|
669
674
|
else
|
675
|
+
|
676
|
+
if raw_selector.nil? and ename != element_part then
|
677
|
+
|
678
|
+
right_cond = element_part[/#{ename}(.*)/,1]
|
679
|
+
|
680
|
+
end
|
670
681
|
|
671
682
|
return_elements = @child_elements.map.with_index.select do |x, i|
|
672
683
|
|
673
684
|
next unless x.is_a? Rexle::Element
|
674
685
|
|
675
|
-
x.name == ename or (ename == '*')
|
686
|
+
#x.name == ename or (ename == '*')
|
687
|
+
|
688
|
+
r10 = ((x.name == ename) or (ename == '*'))
|
689
|
+
|
690
|
+
|
691
|
+
|
676
692
|
end
|
693
|
+
|
694
|
+
if right_cond then
|
695
|
+
|
696
|
+
|
697
|
+
r12 = return_elements.map do |x, i|
|
698
|
+
|
699
|
+
if x.text then
|
677
700
|
|
701
|
+
r11 = eval x.text.to_s + right_cond
|
678
702
|
|
703
|
+
else
|
704
|
+
false
|
705
|
+
end
|
706
|
+
|
707
|
+
end
|
708
|
+
|
709
|
+
return r12
|
710
|
+
|
711
|
+
end
|
712
|
+
|
679
713
|
if selector then
|
680
714
|
ne = return_elements.inject([]) do |r,x|
|
681
715
|
i = x.last + selector
|
@@ -692,8 +726,7 @@ class Rexle
|
|
692
726
|
|
693
727
|
end
|
694
728
|
end
|
695
|
-
|
696
|
-
|
729
|
+
|
697
730
|
if return_elements.length > 0 then
|
698
731
|
|
699
732
|
if (a_path + [remaining_path]).join.empty? then
|
@@ -741,6 +774,7 @@ class Rexle
|
|
741
774
|
|
742
775
|
rlist = rlist.flatten(1) unless rlist.length > 1 \
|
743
776
|
and rlist[0].is_a? Array
|
777
|
+
rlist
|
744
778
|
|
745
779
|
end
|
746
780
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|