rexle-xpath 0.2.13 → 0.2.14
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/lib/rexle-xpath.rb +8 -8
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: 5135103f6e958d5f0a6e6ad07d768f3af2d2a420
|
|
4
|
+
data.tar.gz: e5a751d21332e1aaec6cc59882347c3361c5e24f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab0e89d915d782ceba46e46967e504a6d5d0f548db8cf6b39fc3a5404d0d74554768a191a78149d43fcf7e6ea799b6f6d22fbc2f99529596aa30b43f8f968ccf
|
|
7
|
+
data.tar.gz: 860bf5772638d7070a940f0bb9ed90262ca9d9845e3fe5c6f51c15633121ab5596b90f4f62128d0231716729bf3fe77601c9ae71f8a921d373e914ab079b9271
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/rexle-xpath.rb
CHANGED
|
@@ -22,7 +22,6 @@ class RexleXPath
|
|
|
22
22
|
|
|
23
23
|
def initialize(node=nil, debug: false)
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
@node = node
|
|
27
26
|
@debug = debug
|
|
28
27
|
|
|
@@ -57,9 +56,10 @@ class RexleXPath
|
|
|
57
56
|
row = xpath_instructions.shift
|
|
58
57
|
method_name, *args = row
|
|
59
58
|
|
|
60
|
-
return query node, row if row.first.is_a? Array
|
|
59
|
+
return query node, row + xpath_instructions if row.first.is_a? Array
|
|
61
60
|
|
|
62
61
|
result = method(method_name.to_sym).call node, args, xpath_instructions
|
|
62
|
+
|
|
63
63
|
result.is_a?(Array) ? result.flatten : result
|
|
64
64
|
|
|
65
65
|
end
|
|
@@ -139,6 +139,7 @@ class RexleXPath
|
|
|
139
139
|
xpath_instructions: xpath_instructions
|
|
140
140
|
|
|
141
141
|
nodes_found = node.elements.select {|x| x.name == args.first }
|
|
142
|
+
|
|
142
143
|
flat_xpi = xpath_instructions.flatten
|
|
143
144
|
|
|
144
145
|
predicate = flat_xpi.first.to_s == 'predicate'
|
|
@@ -181,15 +182,14 @@ class RexleXPath
|
|
|
181
182
|
|
|
182
183
|
end
|
|
183
184
|
|
|
184
|
-
def text(node, args, xpath_instructions)
|
|
185
|
-
node.text
|
|
186
|
-
end
|
|
187
|
-
|
|
188
185
|
def value(node, args, xpath_instructions)
|
|
189
186
|
|
|
190
187
|
operator, operand = args
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
if operator then
|
|
189
|
+
node.value.method(operator.to_sym).call operand
|
|
190
|
+
else
|
|
191
|
+
[node.text]
|
|
192
|
+
end
|
|
193
193
|
|
|
194
194
|
end
|
|
195
195
|
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rexle-xpath
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
05Hvy/ad61XnzWtun98claEIk/rC/TxPrbRaOd7vN99WxTy1xn8ElfLSx7CDDrTc
|
|
32
32
|
qN5t1BlRcAgKNw==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2016-05-
|
|
34
|
+
date: 2016-05-26 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rexle-xpath-parser
|
|
@@ -42,7 +42,7 @@ dependencies:
|
|
|
42
42
|
version: '0.1'
|
|
43
43
|
- - ">="
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: 0.1.
|
|
45
|
+
version: 0.1.13
|
|
46
46
|
type: :runtime
|
|
47
47
|
prerelease: false
|
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -52,7 +52,7 @@ dependencies:
|
|
|
52
52
|
version: '0.1'
|
|
53
53
|
- - ">="
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 0.1.
|
|
55
|
+
version: 0.1.13
|
|
56
56
|
description:
|
|
57
57
|
email: james@r0bertson.co.uk
|
|
58
58
|
executables: []
|
metadata.gz.sig
CHANGED
|
Binary file
|