rexle-xpath 0.1.0 → 0.2.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rexle-xpath.rb +25 -4
- metadata +25 -5
- 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: cf2484b60dec398cec31fd15d4fdb5eb9671c709
|
|
4
|
+
data.tar.gz: 23c7da936c86982362c683ff34aad29dba2a72cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9edbc0f90a0f60907355b4e243d455a9df024d65bb3b413df5a007609502a232bf27fba9413d79913f474c9a8cf05dc9016860076339e0bcbeaf774d1289e31c
|
|
7
|
+
data.tar.gz: 70cf9c629140b49899bee288ebd32ef12247d4856fe6d6b64dc99a57546dd4bdeb2324d4ba836853a0bb3f2526638fa2717c4a4c099cf76cae4abf2a24153810
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/rexle-xpath.rb
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# file: rexle-xpath
|
|
4
4
|
|
|
5
|
+
require 'rexle-xpath-parser'
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
class RexleXPath
|
|
7
9
|
|
|
@@ -16,13 +18,24 @@ class RexleXPath
|
|
|
16
18
|
case s
|
|
17
19
|
when /^(\w+)\(\)$/
|
|
18
20
|
@node.method(($1).to_sym).call
|
|
21
|
+
else
|
|
22
|
+
query RexleXPathParser.new(s).to_a
|
|
19
23
|
end
|
|
20
24
|
end
|
|
21
25
|
|
|
22
|
-
def query()
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
def query(a)
|
|
27
|
+
|
|
28
|
+
r = []
|
|
29
|
+
|
|
30
|
+
a.each do |row|
|
|
31
|
+
x, *args = row
|
|
32
|
+
if x == :select then
|
|
33
|
+
r = @node.select args.first
|
|
34
|
+
elsif row.is_a? Array then
|
|
35
|
+
r = query row
|
|
36
|
+
end
|
|
25
37
|
end
|
|
38
|
+
r
|
|
26
39
|
|
|
27
40
|
end
|
|
28
41
|
|
|
@@ -35,6 +48,14 @@ class RexleXPath
|
|
|
35
48
|
def name()
|
|
36
49
|
@element.name()
|
|
37
50
|
end
|
|
51
|
+
|
|
52
|
+
def not()
|
|
53
|
+
@element
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def select(name)
|
|
57
|
+
@element.select(name)
|
|
58
|
+
end
|
|
38
59
|
|
|
39
60
|
def text()
|
|
40
61
|
@element.text()
|
|
@@ -42,4 +63,4 @@ class RexleXPath
|
|
|
42
63
|
|
|
43
64
|
end
|
|
44
65
|
|
|
45
|
-
end
|
|
66
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rexle-xpath
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,8 +31,28 @@ cert_chain:
|
|
|
31
31
|
05Hvy/ad61XnzWtun98claEIk/rC/TxPrbRaOd7vN99WxTy1xn8ElfLSx7CDDrTc
|
|
32
32
|
qN5t1BlRcAgKNw==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2015-
|
|
35
|
-
dependencies:
|
|
34
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
|
35
|
+
dependencies:
|
|
36
|
+
- !ruby/object:Gem::Dependency
|
|
37
|
+
name: rexle-xpath-parser
|
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
- - "~>"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '0.1'
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: 0.1.3
|
|
46
|
+
type: :runtime
|
|
47
|
+
prerelease: false
|
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0.1'
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: 0.1.3
|
|
36
56
|
description:
|
|
37
57
|
email: james@r0bertson.co.uk
|
|
38
58
|
executables: []
|
|
@@ -60,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
60
80
|
version: '0'
|
|
61
81
|
requirements: []
|
|
62
82
|
rubyforge_project:
|
|
63
|
-
rubygems_version: 2.4.
|
|
83
|
+
rubygems_version: 2.4.8
|
|
64
84
|
signing_key:
|
|
65
85
|
specification_version: 4
|
|
66
|
-
summary:
|
|
86
|
+
summary: Under development, and is not currently used by the Rexle gem.
|
|
67
87
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|