rexle 1.3.14 → 1.3.15
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 +18 -8
- 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: 14c6f276ae292ed9e707c76af6996b7ff9b66c34
|
4
|
+
data.tar.gz: f8b62b17790fa2e0b5cdc132a7d9a589a23b95bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff4e2456dde4369a2dc688df333085f2c6579c04954ed1c419c427fd17560d1695590e9fadc2b89c5eebfe90bace5c46a14b33128f41f47fb61639c36ec10268
|
7
|
+
data.tar.gz: 6caaa53b123b3cd2089f5c9794927d53f8e0adba57ec3c349e0160028b231daa06f17ef5ec03ad77509a68d2ca7886761b76ed34f55ffa01c9f92f2c2bb3950e
|
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
|
+
# 15-Mar-2016: bug fix: Reapplied a select case statement (which had
|
16
|
+
# subsequently been deleted) from method attribute_search()
|
15
17
|
# 13-Mar-2016: bug fix: Reapplied a statement that was commented out in
|
16
18
|
# the previous gem release
|
17
19
|
# bug fix: Removed a redundant statement from
|
@@ -310,6 +312,7 @@ class Rexle
|
|
310
312
|
end
|
311
313
|
|
312
314
|
def contains(raw_args)
|
315
|
+
|
313
316
|
#log = Logger.new('rexle.log','daily')
|
314
317
|
#log.debug 'inside contains'
|
315
318
|
path, raw_val = raw_args.split(',',2)
|
@@ -498,7 +501,7 @@ class Rexle
|
|
498
501
|
end
|
499
502
|
|
500
503
|
def query_xpath(raw_xpath_value, rlist=[], &blk)
|
501
|
-
|
504
|
+
|
502
505
|
#@log.debug 'query_xpath : ' + raw_xpath_value.inspect
|
503
506
|
#@log.debug '++ ' + self.xml.inspect
|
504
507
|
|
@@ -519,9 +522,11 @@ class Rexle
|
|
519
522
|
.match(/([^\[]+)(\[[^\]]+\])?/).captures
|
520
523
|
|
521
524
|
remaining_path = ($').to_s
|
525
|
+
|
522
526
|
#@log.debug 'remaining_path: ' + remaining_path.inspect
|
523
527
|
|
524
528
|
if remaining_path[/^contains\(/] then
|
529
|
+
|
525
530
|
raw_condition = raw_condition ? raw_condition + '/' + remaining_path \
|
526
531
|
: remaining_path
|
527
532
|
remaining_path = ''
|
@@ -629,8 +634,12 @@ class Rexle
|
|
629
634
|
r2 = self.parent.xpath(remaining_xpath)
|
630
635
|
|
631
636
|
return r2
|
637
|
+
|
632
638
|
elsif ename == '.'
|
633
|
-
|
639
|
+
|
640
|
+
remaining_xpath = raw_path[1..-1]
|
641
|
+
return remaining_xpath.empty? ? self : self.xpath(remaining_xpath)
|
642
|
+
|
634
643
|
else
|
635
644
|
|
636
645
|
return_elements = @child_elements.map.with_index.select do |x, i|
|
@@ -1069,18 +1078,17 @@ class Rexle
|
|
1069
1078
|
end
|
1070
1079
|
|
1071
1080
|
def scan_match(node, path)
|
1072
|
-
|
1081
|
+
|
1073
1082
|
if path == '//' then
|
1074
1083
|
return [node, node.text,
|
1075
1084
|
node.elements.map {|x| scan_match x, path}]
|
1076
1085
|
end
|
1077
|
-
|
1086
|
+
|
1078
1087
|
r = []
|
1079
1088
|
xpath2 = path[2..-1]
|
1080
|
-
xpath2.sub!(/^\*\//,'')
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1089
|
+
#jr150316 xpath2.sub!(/^\*\//,'')
|
1090
|
+
#jr150316xpath2.sub!(/^\*/,self.name)
|
1091
|
+
#jr150316xpath2.sub!(/^\w+/,'').sub!(/^\//,'') if xpath2[/^\w+/] == self.name
|
1084
1092
|
|
1085
1093
|
r << node.xpath(xpath2)
|
1086
1094
|
r << node.elements.map {|n| scan_match(n, path) if n\
|
@@ -1152,6 +1160,8 @@ class Rexle
|
|
1152
1160
|
end
|
1153
1161
|
elsif attr_search[/e\.xpath/] and eval(attr_search)
|
1154
1162
|
block_given? ? blk.call(e) : e
|
1163
|
+
elsif e.element(attr_search)
|
1164
|
+
block_given? ? blk.call(e) : e
|
1155
1165
|
end
|
1156
1166
|
|
1157
1167
|
r2
|
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.3.
|
4
|
+
version: 1.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Tkua07gB3/nVO3aPg7C3vEbDZCxT3WAMli2uZisYT6ozmdAlDsixLjipgFN4If3z
|
32
32
|
Ej0QR3kvGcAvFQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-03-
|
34
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexleparser
|
metadata.gz.sig
CHANGED
Binary file
|