rexle-xpath 0.2.19 → 0.2.20
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 +2 -3
- data.tar.gz.sig +1 -1
- data/lib/rexle-xpath.rb +42 -5
- metadata +4 -4
- metadata.gz.sig +1 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ad7a52975232684fb9a4803036fcd94296d7e5e
|
|
4
|
+
data.tar.gz: e8f96d4b9775c001b4c6e49bab3d1d8dbfe4362f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: def3a91c928ab1d35e60a07e972375629a4c64378fb4d1db868977d41ff0fbd35e4504151e1e912f18f3f56b7cd9f0a53785deac5ee2be2dce86f1e6c38a7a71
|
|
7
|
+
data.tar.gz: 9f6a2110818b5c027fd1aa579efa51f35b114f9fa55621011155e3fc88c3b9042e9dfe683e9d319941ee341c50409fce69ca4c5362d6119a3f0c03a174061746
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
H
|
|
3
|
-
(�����y��@�[�,S�h�O�*�<�"��(�w��W��?'�r�u�
|
|
1
|
+
��v���c��<�o���5[��8��3��s�XI�Q�qI�ɳ�"�h
|
|
2
|
+
����H��h15MN�T���Y�f��Y���vxph��-�Nn�؝�� �vG��)>�A�R>.�"B��pm���4C�|��d���FWǹvc�~�.k\�[T�h:����d"Y�z!_�G��6�M(�9������o�F���w@0����=$�<�o��ѕ��Yj�'����ҁ˩U\��q}&"ݵ����ň�
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
o�(�3�u�������xѼ��Z�F�G�ds]�MB�aK���V1�R}��>�",�%HX���(���������� ��q5�R}��똫�mv�Gǐ��o�3��aA���A=B��)�|��*�bc\�l۱H[�hֈ!� ��Ԩ�N����7fq�,I��-�(�yJCr$����8^NM���a_�~�:��?Tg�i�*g��M�J$�<�U��x�ć'8��c&��h�Vd�;�K9?��E�n������
|
data/lib/rexle-xpath.rb
CHANGED
|
@@ -53,12 +53,41 @@ class RexleXPath
|
|
|
53
53
|
debug :query, node: node, xpath_instructions: xpath_instructions
|
|
54
54
|
|
|
55
55
|
row = xpath_instructions.shift
|
|
56
|
-
method_name, *args = row
|
|
56
|
+
method_name, *args = row
|
|
57
57
|
|
|
58
58
|
return query xpath_instructions, node if row == :|
|
|
59
59
|
|
|
60
|
-
if row.is_a? Array and row.first.is_a? Array then
|
|
61
|
-
|
|
60
|
+
if row.is_a? Array and row.first.is_a? Array then
|
|
61
|
+
|
|
62
|
+
unless row.any? {|x| x == :|} then
|
|
63
|
+
|
|
64
|
+
return query row + xpath_instructions, node
|
|
65
|
+
else
|
|
66
|
+
|
|
67
|
+
a = row
|
|
68
|
+
|
|
69
|
+
a2 = a.inject([[]]) do |r, x|
|
|
70
|
+
|
|
71
|
+
if x != :| then
|
|
72
|
+
|
|
73
|
+
if r.last.is_a? Array then
|
|
74
|
+
r.last << x
|
|
75
|
+
else
|
|
76
|
+
r << [x]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
else
|
|
80
|
+
r.unshift x
|
|
81
|
+
r << []
|
|
82
|
+
end
|
|
83
|
+
r
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
name = a2.shift
|
|
87
|
+
r3 = method(name).call(a2, node)
|
|
88
|
+
return r3
|
|
89
|
+
|
|
90
|
+
end
|
|
62
91
|
end
|
|
63
92
|
|
|
64
93
|
result = if method_name == :predicate then
|
|
@@ -83,11 +112,19 @@ class RexleXPath
|
|
|
83
112
|
|
|
84
113
|
private
|
|
85
114
|
|
|
115
|
+
|
|
116
|
+
def |(args=[], node)
|
|
117
|
+
r = args.flat_map {|x| query x, node}
|
|
118
|
+
r.any?
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
|
|
86
122
|
def attribute(node, args, xpath_instructions)
|
|
87
123
|
|
|
88
|
-
debug :attribute, node: node,
|
|
124
|
+
debug :attribute, args: args, node: node,
|
|
125
|
+
xpath_instructions: xpath_instructions
|
|
89
126
|
|
|
90
|
-
key = args.first.to_sym
|
|
127
|
+
key = args.first.is_a?(Array) ? args.first.first.to_sym : args.first.to_sym
|
|
91
128
|
|
|
92
129
|
attr = node.attributes[key]
|
|
93
130
|
|
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.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
nbFbbz3OsHrrR6h7FB5a8wQzCvYMtAr9VMPNl01QqBRi2wCEr6hR3gGBY0T1ZT5P
|
|
32
32
|
qYzPWuECaMhR5w==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date:
|
|
34
|
+
date: 2017-02-19 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rexle-xpath-parser
|
|
@@ -54,7 +54,7 @@ dependencies:
|
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
55
|
version: 0.1.13
|
|
56
56
|
description:
|
|
57
|
-
email: james@
|
|
57
|
+
email: james@jamesrobertson.eu
|
|
58
58
|
executables: []
|
|
59
59
|
extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
80
|
version: '0'
|
|
81
81
|
requirements: []
|
|
82
82
|
rubyforge_project:
|
|
83
|
-
rubygems_version: 2.
|
|
83
|
+
rubygems_version: 2.6.8
|
|
84
84
|
signing_key:
|
|
85
85
|
specification_version: 4
|
|
86
86
|
summary: Under development, and is not currently used by the Rexle gem.
|
metadata.gz.sig
CHANGED