rexle-xpath 0.2.11 → 0.2.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61da0cdbbfd699e274a143595129d7fcbfbf5bd7
4
- data.tar.gz: 36d141bd9ff0e17672d1c232b84b915244a49747
3
+ metadata.gz: 479dc6d4c1f6c7c3270c9966af77acad9efc3654
4
+ data.tar.gz: b739041bf097a2faf1deb484744ba3a62d6a5615
5
5
  SHA512:
6
- metadata.gz: 7f05b9707cfa765f7824d634b12574b204f7c0de5f510e11971856f63a4984a5211a79b4b125aacaedbe02310a8c13dbe46721e8bd8a488bd540fb503ef8e0e0
7
- data.tar.gz: be2cb26d7d4e5fae330f79dbd6df76900bc5d3ee90502aa788cd9de6e629add7c02be4ae4cbe9d001738aa5f274be520f1ef46d033274ffa5e6e8e57941a3da1
6
+ metadata.gz: c4262efd3070eceb1d64dd5ca592f288392862f56ae5c8938418f30b8aedfb064137ec9db8fd2f25df807bc4954c6d1fc63468ced5bdf06f9a7d0fcbb2740544
7
+ data.tar.gz: f5e6f9a12c7399f4e2e3940ae91e7206b5d4e7172aa5de7f8104f02d56279ee3abdbf050430e79269ad779133276759bbdf883b1d5a2dcb6c5876765c8682b58
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle-xpath.rb CHANGED
@@ -62,6 +62,8 @@ class RexleXPath
62
62
 
63
63
  def attribute(node, args, xpath_instructions)
64
64
 
65
+ debug :attribute, node: node, xpath_instructions: xpath_instructions
66
+
65
67
  key = args.first.to_sym
66
68
 
67
69
  attr = node.attributes[key]
@@ -108,6 +110,7 @@ class RexleXPath
108
110
  xpath_instructions: xpath_instructions
109
111
 
110
112
  r = query node, args
113
+
111
114
  r.is_a?(Array) ? r.any? : r
112
115
 
113
116
  end
@@ -128,6 +131,9 @@ class RexleXPath
128
131
 
129
132
  def select(node, args, xpath_instructions)
130
133
 
134
+ debug :select, node: node, args: args,
135
+ xpath_instructions: xpath_instructions
136
+
131
137
  a = node.elements.select {|x| x.name == args.first }
132
138
  flat_xpi = xpath_instructions.flatten
133
139
 
@@ -155,10 +161,12 @@ class RexleXPath
155
161
  predicate ? r << child_node : r << true
156
162
  when :FalseClass
157
163
  !predicate ? r << false : r
164
+ when :'Rexle::Element::Attribute'
165
+ r << child_node
166
+ when :NilClass
167
+ r
158
168
  else
159
-
160
- r2.any? ? r << r2 : r
161
-
169
+ r2.any? ? r << r2 : r
162
170
  end # /case
163
171
 
164
172
  end # /inject
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.11
4
+ version: 0.2.12
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-23 00:00:00.000000000 Z
34
+ date: 2016-05-24 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexle-xpath-parser
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- g1�;y�|�v �,����} ��\��Sg*�,`��Ŗ_W�����/���Y
2
- ����W���6u�ڰ^��է�L�BCDʧx��������Ó��\�g^��9bC���z����ʴ��,�aD���h)w80�`��k��z1�u��<��BHB4���I3�$���s%��P��B����E)��Q����
1
+ db��XTb<��ZZ��s��,�WO4
2
+ c;؏�e��2��T�D�Ô li��P��aO���h�D&��$���O�W����ʟNW�-)��9)l�+�d0x�1l��We�Su`K��f:qۆ��u���X��+A��l�)�M��ў�
3
+ �Ƕ�D��~�n��"��h�J�4��M_��d�����k���