rexle 1.0.36 → 1.0.37

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: 4967f26b63bcfada703395e8d5ff04b652671185
4
- data.tar.gz: a1ad04fe5257358c2713c918fb7429392c1ce1e6
3
+ metadata.gz: d16279a81b765893864448fdd7eea0d9e1e3294f
4
+ data.tar.gz: a81d96de8211008d44be417a37d4b8b6a416e688
5
5
  SHA512:
6
- metadata.gz: e446a0360e03d39a8f0a2d1669616eca65ab13b1c2a9b9ed708eaa1f06d62bbfb389c356d71f8f591693e0fd452d4caec6b5ab36105b57a041930222022879ed
7
- data.tar.gz: 3fc8dc811e3f2c9ce738ae3c03823e9094f45505f460595f19950b4d8fc3c001c7f03d7f6429ff62a1be91a76b8140e3438922a63e935b249e5188fc329d9dbe
6
+ metadata.gz: b389e4a0c3886fb6a2fa49fdaf0c5be30a109a6d100672185404625a192b1a92cb12bff5a2fc4c71da694522530df7fd181dbfc85a7882bcb1bdc621c7bd55eb
7
+ data.tar.gz: c1ce9a1a1d17e0b00616c40ca861fabb69e5d1556d8c09b6f8e18e6a0c959f015e42f1520d35e903023a86dac1966a78e004a6c558a1054611478a327b4ee3fc
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle.rb CHANGED
@@ -12,7 +12,9 @@ include REXML
12
12
 
13
13
  # modifications:
14
14
 
15
- # 07-Dec-2014: featureL The Rexle::Element#Css() parameter can now contain
15
+ # 20-Dec-2014: bug fix: Fixes an uncommon XPath selection.
16
+ # see http://www.jamesrobertson.eu/bugtracker/2014/dec/18/xpath-returns-an-empty-list.html
17
+ # 07-Dec-2014: feature: The Rexle::Element#Css() parameter can now contain
16
18
  # multiple css paths within the string e.g. '.abc, div'
17
19
  # 30-Nov-2014: feature: XPath now supports parent (..) traversal e.g. b/../b2
18
20
  # 21-Nov-2014: feature: Added at_css() to select a single element
@@ -899,8 +901,12 @@ class Rexle
899
901
  if x[0] != '.' then
900
902
  if x[0][/\//] then
901
903
  path, value = x.values_at(0,-1)
902
-
903
- "r = e.xpath('#{path}').first; r and r.value == #{value}"
904
+
905
+ if x[0][/@\w+$/] then
906
+ "r = e.xpath('#{path}').first; r and r == #{value}"
907
+ else
908
+ "r = e.xpath('#{path}').first; r and r.value == #{value}"
909
+ end
904
910
  else
905
911
  "(name == '%s' and value %s '%s')" % [x[0], x[1], x[2].sub(/^['"](.*)['"]$/,'\1')]
906
912
  end
@@ -986,6 +992,7 @@ class Rexle
986
992
  elsif attr_search[/^\(name ==/] and eval(attr_search)
987
993
  block_given? ? blk.call(e) : e
988
994
  elsif attr_search[/^e\.value/]
995
+
989
996
  v = attr_search[/[^\s]+$/]
990
997
  duck_type = %w(to_f to_i to_s).detect {|x| v == v.send(x).to_s}
991
998
  attr_search.sub!(/^e.value/,'e.value.' + duck_type)
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.0.36
4
+ version: 1.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  UOGKUMV5RApHDnC0ywMYNe0HK7qMSTP5YLKs8JUjNxpc5jl8+o3D3sHkNN4DzbQm
32
32
  jVfzDZ+niKvAUA==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-12-07 00:00:00.000000000 Z
34
+ date: 2014-12-20 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexleparser
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- B,��J����!���Y�a�Ci� �2[��V�x_���?2�d�9igA��H(I���-�JD��4m\��>�*VaS�EP�>�v���6�ݫ�-c&D���Fu�,;��/cq}�����?�6K�.�?�;�n&X��� y�eY��]6���G����Rs�����&�)�)�`��
2
- J{ Q@�A �;���IigW�^mu�;�h� ���aXq�u�D\Պ����N[aߴT�JL
1
+ ��_O~�I���qȨ#���>���"|���W΀R�������M���cz2���?� UU?#��bP��d�tN�Åw_N��TW�>�u��-<'���58>�ESZ:�
2
+ �;�n5uy͜d��R��W���~m�J
3
+ �4�����B��ƍ�C*��j8�g����-��c�m���L���碵R�w�+�O�B ����[��