backtrack-xpath 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/backtrack-xpath.rb +9 -6
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7700f403750a2c93e5fd0e383cd6f2724d5c847b
|
4
|
+
data.tar.gz: a71fa23c970f1efab690514b72907ee0c806b990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38ccdda7e1accd818823fe89ca13b21e5ec023432ddb15c9ae0fb2e30ef65f38cec628c15d10f788c7abe0f163ed77cda86b0d0c78d92dd702a27b4b76589aef
|
7
|
+
data.tar.gz: 60e00faaca92b305d83d53030d887b40733b2576c0233704389138737a598581979776757f35bbb68a0d1b5da029ee57ebf5d10e896ab6add1eae1296fad9b66
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/backtrack-xpath.rb
CHANGED
@@ -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 =
|
31
|
-
|
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.
|
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-
|
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
|