backtrack-xpath 0.1.2 → 0.1.3

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: 3981135c29328cf454ee49b301a516ccead32dcc
4
- data.tar.gz: 312ad51dc3d07d963a2ed3f0ac301c355cbaf0ba
3
+ metadata.gz: 7700f403750a2c93e5fd0e383cd6f2724d5c847b
4
+ data.tar.gz: a71fa23c970f1efab690514b72907ee0c806b990
5
5
  SHA512:
6
- metadata.gz: 4174c5e8be3738ae3b78f105f7314044f04697d6746d2da91e8821d5262920785711641eeaa44ffd42dfaf6b9706c53062cfc55f8e66b6c41e72119047efb1ea
7
- data.tar.gz: 5c2c432e5e458eef631d51fc93e16168bbff7cac11a6bf0aac680f131cb6d8dea385e079177dd850ecd8d8ef4bafc648e78cfbb610fccabac1d4b7097e04d0b7
6
+ metadata.gz: 38ccdda7e1accd818823fe89ca13b21e5ec023432ddb15c9ae0fb2e30ef65f38cec628c15d10f788c7abe0f163ed77cda86b0d0c78d92dd702a27b4b76589aef
7
+ data.tar.gz: 60e00faaca92b305d83d53030d887b40733b2576c0233704389138737a598581979776757f35bbb68a0d1b5da029ee57ebf5d10e896ab6add1eae1296fad9b66
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  # file: backtrack-xpath.rb
4
4
 
@@ -15,6 +15,7 @@ class BacktrackXPath
15
15
  private
16
16
 
17
17
  def attribute_scan(node)
18
+
18
19
  result = ''
19
20
  attr = %w(id class).detect {|x| node.attributes.has_key? x}
20
21
  if attr then
@@ -24,10 +25,12 @@ class BacktrackXPath
24
25
  result
25
26
  end
26
27
 
27
- def doc_scan(node)
28
+ def doc_scan(node)
29
+
28
30
  name = node.name
29
- attribute = attribute_scan(node)
30
- result = doc_scan(node.parent) if node.parent.name != node.root.name
31
- [result, name.to_s + attribute]
31
+ attribute = node.attributes ? attribute_scan(node) : ''
32
+ result = node.parent.parent ? doc_scan(node.parent) : ''
33
+
34
+ [result, name + attribute]
32
35
  end
33
- end
36
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backtrack-xpath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  D68AHrY+HVcN5hmz3ZlMebqNQ4KmKT9Ff9TsPMjPA1mwX3HGV6bsBMZ0ZqTgT7X4
30
30
  N1iY0ViTNaILv4mYQCc18VIgMV1qlMFX
31
31
  -----END CERTIFICATE-----
32
- date: 2013-07-27 00:00:00.000000000 Z
32
+ date: 2013-10-09 00:00:00.000000000 Z
33
33
  dependencies: []
34
34
  description:
35
35
  email: james@r0bertson.co.uk
@@ -48,12 +48,12 @@ require_paths:
48
48
  - lib
49
49
  required_ruby_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - '>='
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
metadata.gz.sig CHANGED
Binary file