xml-registry 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30da50a0a1fdef4b0f49ec83c0bece988dfa032b
4
- data.tar.gz: 4bea2ee73b51dee8de463e46d4d5d18481a6d0bd
3
+ metadata.gz: 3730a4bb1b989b5b2220a078f7fdac48787b4260
4
+ data.tar.gz: b39de156b2e96337b9725c1ebe7ca2a49390eabf
5
5
  SHA512:
6
- metadata.gz: 0f07f197eb12aaeb44c80c909299cb5a6f4f07f2c5aae95c73aca1809c9de155e0b26d0a27ce980540df94d9b88d129f8cdcb246d1791669209b3ca5ce549446
7
- data.tar.gz: 038204172e70170be75a87c21c12bd600e65f41a203cfdd4ebf58acf8102647ad915c1b5fbc29b2fe5d6ae17c355aa06d283ca69fb4c255414dbc30b315d49c7
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.0
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-08-10 00:00:00.000000000 Z
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