xml-registry 0.5.5 → 0.6.0

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
- SHA1:
3
- metadata.gz: cc43f0be17ff1f5235c00da9ed66c45921e168e2
4
- data.tar.gz: 6263b832634d17c8cb4b301d46248374d1b6b5ab
2
+ SHA256:
3
+ metadata.gz: 1be5e09b2429e5cca7b0cec165269845ad9bda4fbf7384705f2b884d814381bd
4
+ data.tar.gz: 04d20465fd4a50bb43a214767904014401ae7437d389a00fde627cbfa9ccd5dd
5
5
  SHA512:
6
- metadata.gz: 932f7a6c13b5fb591436d531d01a00d177f20d967c07f0708bd8c8770641e601c0e4aa1900d3a5e0ca006b3afdeb2b3aaaaeebc79aef883a3029101290d63314
7
- data.tar.gz: 6a7245b6c454b6ca29f43a01c169d9b33bfa511bdf77ed016d3dd30535d48b657052dd966d9cce1d0a1f92bf13342c166c547f6883049b5fa63840de1f1153fc
6
+ metadata.gz: c2c0ed23c3128cbff4c697a6944813b7d5d65816929a8e05ba3874152445ebfc4def88394efbaa5dde494a3f1bdb225f5d3297247eb2c354b14e6bd835e04c42
7
+ data.tar.gz: 26e18295443a69b2632138c749723173d7d8f0326190951217f33e3d20416e0b47840eb4f1c35e7f17a630e87b0e72c037bb1efd52359e4a06b197b879ff7345
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/xml-registry.rb CHANGED
@@ -23,7 +23,9 @@ class XMLRegistry
23
23
 
24
24
  attr_reader :doc
25
25
 
26
- def initialize(template = '<root></root>')
26
+ def initialize(template = '<root></root>', debug: false)
27
+
28
+ @debug = debug
27
29
  super()
28
30
  @template, _ = RXFHelper.read(template)
29
31
  @doc = Rexle.new(@template)
@@ -181,6 +183,25 @@ class XMLRegistry
181
183
  [x[/^\[(.[^\]]+)\]/,1], Hash[*($').scan(/"([^"]+)"="(.[^"]*)"/).flatten]]
182
184
  end
183
185
 
186
+ elsif reg_buffer.strip.lines.grep(/^\s+\w/).any?
187
+
188
+ puts 'hierachical import' if @debug
189
+ doc = LineTree.new(reg_buffer).to_doc
190
+
191
+ reg_items = []
192
+
193
+ doc.root.each_recursive do |e|
194
+
195
+ puts 'e: ' + e.inspect if @debug
196
+ if e.is_a?(Rexle::Element) and e.children.length < 2 then
197
+
198
+ reg_items << [e.backtrack.to_xpath.sub(/^root\//,'')\
199
+ .sub(/\/[^\/]+$/,''), {e.name => e.text }]
200
+
201
+ end
202
+
203
+ end
204
+
184
205
  else
185
206
 
186
207
  reg_items = reg_buffer.split(/(?=^[^:]+$)/).map do |raw_section|
@@ -195,6 +216,7 @@ class XMLRegistry
195
216
 
196
217
  end
197
218
 
219
+ puts 'reg_items: ' + reg_items.inspect if @debug
198
220
  reg_items.each do |path, items|
199
221
  items.each {|k,value| self.set_key("%s/%s" % [path,k], value)}
200
222
  end
@@ -262,4 +284,4 @@ class XMLRegistry
262
284
  out
263
285
  end
264
286
 
265
- end
287
+ end
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.5.5
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,28 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE3MDgzMDE5MDg0MVoXDTE4MDgzMDE5MDg0MVowSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
- EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC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LbDOchJ0A
30
+ p28M0LkVNwD4mhmW4Dqon/VX7RyL2HOa1bogK7k038wktuCm1i0l4a71//oZuUfh
31
+ eB8r9R7SX7prHyFnBSgDtfEHedWjg+eFJpmWlly3oHM8vNXoHfhomSAaoHy7ivRS
32
+ bF4593JPPQdcsxZzciAElMmjMAM7OEyJiRkCFwC/KkSJ8OAHXYVuIrczPcefGvs4
33
+ fnNfCqQzWQLJf2K0fTSFZRj33W3jAiEfgGfP4Q2APkfclUm5oO9sFwWbrkhDwZxl
34
+ Lev5l1ly85ZtYlLIotu/PL3cPeohnZPY7rI+HGoHC21O6a99qVQXFP+kkErs81mo
35
+ MYGFLBUz5wXgJgx3utFrNJwLp7Y4wEAzL5KoeySaQub6rFUeCGfpi/Verm9WPRqH
36
+ oY185KtHIZDihehN4jjAxIqU
33
37
  -----END CERTIFICATE-----
34
- date: 2018-01-25 00:00:00.000000000 Z
38
+ date: 2018-10-03 00:00:00.000000000 Z
35
39
  dependencies:
36
40
  - !ruby/object:Gem::Dependency
37
41
  name: simple-config
@@ -42,7 +46,7 @@ dependencies:
42
46
  version: '0.6'
43
47
  - - ">="
44
48
  - !ruby/object:Gem::Version
45
- version: 0.6.1
49
+ version: 0.6.4
46
50
  type: :runtime
47
51
  prerelease: false
48
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,7 +56,7 @@ dependencies:
52
56
  version: '0.6'
53
57
  - - ">="
54
58
  - !ruby/object:Gem::Version
55
- version: 0.6.1
59
+ version: 0.6.4
56
60
  description:
57
61
  email: james@jamesrobertson.eu
58
62
  executables: []
@@ -80,8 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
84
  version: '0'
81
85
  requirements: []
82
86
  rubyforge_project:
83
- rubygems_version: 2.6.13
87
+ rubygems_version: 2.7.6
84
88
  signing_key:
85
89
  specification_version: 4
86
- summary: xml-registry
90
+ summary: The XML registry can be used to store or retrieve app settings etc. in an
91
+ XML document.
87
92
  test_files: []
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- T�@Ew���A����+m�����{ʏ��/�e ��`m���y�\D�!��}ƍ
1
+ ��0�V��e�f*{G[)E^�Db�&aI����X�v�U�+�8l��`��P�K�}��Z�BӰ4 s:��y���@��]JN ^﷕�7�~)�
2
+ �N�w�o�`�k����3����+{