rexle 1.3.19 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d4a05c0029e1844f848445f0253e656e76fd74e
4
- data.tar.gz: 864e6fa3e813adf522b6196baed511be871aa750
3
+ metadata.gz: 13914206676963d56c9a33f53675fa7e37c9cb61
4
+ data.tar.gz: 16b304b9a20a10940b7e1f8b919234ef2d44be28
5
5
  SHA512:
6
- metadata.gz: f31e0edfe2fd742b66e7f6e2de4b87b6b15e5f748d8a14f07612b950f59d24adb47726310a85360f33acb085a3102b56bde1cd6bf505050be4a1b53d2a300fd8
7
- data.tar.gz: 1d553faa32a0e308f41c50e3ffe9804259960cd4b2687a253d26af7e67cdeb278f85ac9b5435824945e0aada4d42020955cfba3476041e206ed2fbb0d2d491aa
6
+ metadata.gz: e0bda0e89b6c9d01bcd6fc676a658d40d8ab5352f851d701a7be3bd9413efe7944b187079fc307fa74145092aaaaf83f684f6e3efd7b6aa28415b2c960bf79c1
7
+ data.tar.gz: 8925d282bb3314f758b6b5458208594f9b829d304dd535cd2afb83ddd5d532789aea211d36a2bbd9b096c865d72d3311078492ae2d932c1b0a1263be5f0e6c1d
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
+ # 21-Apr-2016: An xpath predicate can now contain the mod operator as well as
16
+ # containing nested logic e.g. [(position() mod 2) == 1]
15
17
  # 16-Apr-2016: improvement: The HTML element div is no longer printed as
16
18
  # a self-closing tag if empty
17
19
  # 04-Apr-2016: bug fix: modified the bug fix from the 15-Mar-2016 to
@@ -1010,7 +1012,10 @@ class Rexle
1010
1012
  if raw_items[0][/^\d+$/] then
1011
1013
  return raw_items[0].to_i
1012
1014
  elsif raw_items[0] == 'position()' then
1013
- rrr = "i %s %s" % [raw_items[1].gsub('&lt;','<').gsub('&gt;','>').gsub('=','=='), raw_items[-1]]
1015
+
1016
+ rrr = condition[1..-2].gsub(/position\(\)/,'i').gsub('&lt;','<')\
1017
+ .gsub('&gt;','>').gsub(/\s=\B/,' ==').gsub(/\bmod\b/,'%')
1018
+
1014
1019
  return rrr
1015
1020
  elsif raw_items[0][/^contains\(/]
1016
1021
  return raw_items[0]
@@ -1138,10 +1143,10 @@ class Rexle
1138
1143
  end
1139
1144
 
1140
1145
  def attribute_search(attr_search, e, h, i=nil, &blk)
1141
-
1146
+
1142
1147
  r2 = if attr_search.is_a? Fixnum then
1143
1148
  block_given? ? blk.call(e) : e if i == attr_search
1144
- elsif attr_search[/i\s(?:<|>|==)\s\d+/] and eval(attr_search) then
1149
+ elsif attr_search[/i\s(?:<|>|==|%)\s\d+/] and eval(attr_search) then
1145
1150
  block_given? ? blk.call(e) : e
1146
1151
  elsif h and !h.empty? and attr_search[/^h\[/] and eval(attr_search) then
1147
1152
  block_given? ? blk.call(e) : e
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.19
4
+ version: 1.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  pOw2Fx4uv9tO6wagRTcaHduxkh4jYfPDQI9mODFccHeY+wRLDGTENQwIILvMgEa7
32
32
  50vRuyU+obGfjg==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-04-16 00:00:00.000000000 Z
34
+ date: 2016-04-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexleparser
metadata.gz.sig CHANGED
Binary file