rexle 1.3.24 → 1.3.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50783241717d52838cb563f1597366f8c7ed5fb3
4
- data.tar.gz: 53abc4c8932cb1c4945ed414bc731931797f4b39
3
+ metadata.gz: 7da47f8001a64e9aceee1d162829c66ec3334c57
4
+ data.tar.gz: a9f17ccda8b13401b56198dac0c6c8bf3abca4ec
5
5
  SHA512:
6
- metadata.gz: 6ac63ab6be0d1d501be89d8515cb37cfa48ef31993f8a2fe0ed3b70d96e2e209b336d7c80a64a60b8d1db4925285995073ba38ecc62ce92503b02811ede58a7c
7
- data.tar.gz: 4dd0880b32a643bb98cd39002ae983df5a085514cfd54483ed55be7a89bb6937fefcfdcccd301229f44f57ef3365b1219e2101a010e061f0ddec68d92eac67ad
6
+ metadata.gz: 8f83eecbb739ee7ec616145f2f26982c9f02fa03ce98c4b001e0f09474cfa77726b98fc0961466f16ec01a1f09d0c3d05136162ecbe8532b38e51aef40696b22
7
+ data.tar.gz: 6c228aec57852e66e76e8fa40cff9cb6fd56606f7fba06130d9e20221192a5848d9ea51b66fb43d04328a2305d3b25500344ad6d3a3e4f1160862c67437a2df5
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -12,6 +12,8 @@ require 'backtrack-xpath'
12
12
 
13
13
  # modifications:
14
14
 
15
+ # 22-Apr-2016: revision: The previous feature can now include simple
16
+ # predicate logic e.g. 2 < 5
15
17
  # 22-Apr-2016: feature: Using an XPath A pure logic predicate can now be
16
18
  # processed e.g. (4 % 1) != 1
17
19
  # 21-Apr-2016: feature: The xpath() method now returns a Rexle::Recordset object
@@ -579,15 +581,19 @@ class Rexle
579
581
  # isolate the xpath to return just the path to the current element
580
582
 
581
583
  elmnt_path = s[/^([a-zA-Z:\-\*]+\[[^\]]+\])|[\/]+{,2}[^\/]+/]
582
-
583
584
  element_part = elmnt_path[/(^@?[^\[]+)?/,1] if elmnt_path
584
585
 
585
586
  if element_part then
586
587
 
587
- unless element_part[/^(@|[@\.\w]+[\s=])/] then
588
+ unless element_part[/^(@|[@\.a-zA-Z]+[\s=])/] then
589
+
588
590
  element_name = element_part[/^[\w:\-\*\.]+/]
591
+
592
+ if element_name and element_name[/^\d/] then
593
+ element_name = nil
594
+ end
589
595
 
590
- condition = raw_xpath_value unless element_name
596
+ condition = raw_xpath_value if element_name.nil?
591
597
 
592
598
  else
593
599
  if xpath_value[/^\[/] then
@@ -595,7 +601,6 @@ class Rexle
595
601
  element_name = nil
596
602
  else
597
603
  condition = element_part
598
-
599
604
  attr_search = format_condition('[' + condition + ']')
600
605
  #@log.debug 'attr_search : ' + attr_search.inspect
601
606
  return [attribute_search(attr_search, \
@@ -605,7 +610,7 @@ class Rexle
605
610
  end
606
611
 
607
612
  end
608
-
613
+
609
614
  #element_name ||= '*'
610
615
  raw_condition = '' if condition
611
616
 
@@ -1021,9 +1026,9 @@ class Rexle
1021
1026
 
1022
1027
  def format_condition(condition)
1023
1028
 
1024
- raw_items = condition[1..-1].scan(/\'[^\']*\'|\"[^\"]*\"|\
1029
+ raw_items = condition.sub(/\[(.*)\]/,'\1').scan(/\'[^\']*\'|\"[^\"]*\"|\
1025
1030
  and|or|\d+|[!=<>%]+|position\(\)|contains\([^\)]+\)|notx\([^\)]+\)|[@\w\.\/&;]+/)
1026
-
1031
+
1027
1032
  if raw_items[0][/^\d+$/] then
1028
1033
 
1029
1034
  if condition[0 ] == '[' then
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.24
4
+ version: 1.3.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file