rexle 0.9.29 → 0.9.30

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.
Files changed (2) hide show
  1. data/lib/rexle.rb +7 -4
  2. metadata +2 -2
data/lib/rexle.rb CHANGED
@@ -525,11 +525,14 @@ class Rexle
525
525
  end
526
526
 
527
527
 
528
- def scan_match(node, xpath)
528
+ def scan_match(node, path)
529
529
 
530
- #r = node.xpath(xpath[2..-1].sub(/^\w+\/?/,''))
531
- r = node.xpath(xpath[2..-1]) || []
532
- r << node.children.map {|n| scan_match(n, xpath) if n.is_a? Rexle::Element}
530
+ r = []
531
+ xpath2 = path[2..-1]
532
+ xpath2.sub!(/^\w+/,'').sub!(/^\//,'') if xpath2[/^\w+/] == self.name
533
+
534
+ r << node.xpath(xpath2)
535
+ r << node.children.map {|n| scan_match(n, path) if n.is_a? Rexle::Element}
533
536
  r
534
537
  end
535
538
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rexle
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.29
5
+ version: 0.9.30
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-06-17 00:00:00 Z
13
+ date: 2012-06-18 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rexleparser