xml-registry 0.2.0 → 0.2.1
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/lib/xml-registry.rb +4 -13
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 3730a4bb1b989b5b2220a078f7fdac48787b4260
|
4
|
+
data.tar.gz: b39de156b2e96337b9725c1ebe7ca2a49390eabf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f32997086251dd6431aee52e4ef18c6cb56872612b2692c65715300a762db6a3db921ecde93fb67b3643f725b9068a4137903d26d640da33cf566f0dc55bef43
|
7
|
+
data.tar.gz: 845accf8cbd904387396814e59cc631e308298a5da8810919339cef05bb472b195ec31c0a205fc37c4dc54df0ce41ac5c68b5671862bf15b4a62b163e42ac531
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/xml-registry.rb
CHANGED
@@ -50,7 +50,9 @@ class XMLRegistry
|
|
50
50
|
# returns the value as a Rexle::Element
|
51
51
|
#
|
52
52
|
def get_key(path)
|
53
|
-
@doc.root.element path
|
53
|
+
key = @doc.root.element path
|
54
|
+
raise ("xml-registry: key %s not found" % path) unless key
|
55
|
+
key
|
54
56
|
end
|
55
57
|
|
56
58
|
# get several keys using a Rexle XPath
|
@@ -86,7 +88,7 @@ class XMLRegistry
|
|
86
88
|
# load a new registry xml document replacing the existing registry
|
87
89
|
#
|
88
90
|
def load_xml(s='')
|
89
|
-
@doc = Rexle.new(read(s))
|
91
|
+
@doc = Rexle.new(RXFHelper.read(s)[0])
|
90
92
|
self
|
91
93
|
end
|
92
94
|
|
@@ -180,16 +182,6 @@ class XMLRegistry
|
|
180
182
|
key_builder("#{parent_path}/#{key}", create_path) unless create_path.empty?
|
181
183
|
end
|
182
184
|
|
183
|
-
def read(s)
|
184
|
-
if s[/^https?:\/\//] then
|
185
|
-
buffer = open(s, "UserAgent" => "Ruby Registry-reader").read
|
186
|
-
elsif File.exists? s then
|
187
|
-
buffer = File.open(s).read
|
188
|
-
else
|
189
|
-
buffer = s
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
185
|
def print_scan(node, parent=[])
|
194
186
|
out = []
|
195
187
|
parent << node.name
|
@@ -211,4 +203,3 @@ class XMLRegistry
|
|
211
203
|
|
212
204
|
end
|
213
205
|
|
214
|
-
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml-registry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
m8++OvC3wZJ60rgKYqxfVYDFYuaMttCZlmtJeF5LerbwGPPIjGwvIeYDLqBJRuA6
|
30
30
|
4KclOqKpfBFvuefX+F9YSO3aO94nnzhV
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2013-
|
32
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|