xml-registry 0.4.4 → 0.5.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
2
  SHA1:
3
- metadata.gz: 961314e389801d1b85fb36fe202975a4b6e3f9ba
4
- data.tar.gz: e4ed539117b789c5fe9069fa273af619a8798789
3
+ metadata.gz: 0e49bef3fd75dd4915a13fafb8323f237e09843f
4
+ data.tar.gz: 2219b82b077216d24989793bc941cb5669741b64
5
5
  SHA512:
6
- metadata.gz: a86af24c976f18c440ca9839658b2331705e09216a7fe9f7078e5daf110f0362568a82d2f9cde755dbfab6e626520e70f466d8675c69736c9b04eccd621cb65e
7
- data.tar.gz: 49e346543acc270cd3a28ffe2c28b1be9aec0276a014cd19032944d54e9161606513e24217e0ab4bf07d9c7893f47844605366b56411e6189c317d05362447c7
6
+ metadata.gz: ef309b0c7e11bf75ccc9ad180a592b2b7b1ca9b392244ee11f10abdf2bc0d94bae06e167f6c44956d562038d2c583f1bb1405f0d90a4ef9aac590a893011b418
7
+ data.tar.gz: a7d79c4d122a5b83361ac0a5138e5374414a0de243f7f66be3196a89abd4bd2447887886dcbd485a36117a23f3aa4b2d8a1650683a7bf136632635a5d44b7178
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/xml-registry.rb CHANGED
@@ -34,14 +34,17 @@ class XMLRegistry
34
34
 
35
35
  # if the 1st element doesn't exist create it
36
36
  e = path.split('/',2).first
37
+
37
38
  @doc.root.add_element Rexle::Element.new(e) unless @doc.root.element e
38
39
  create_path = find_path(path)
39
-
40
+
40
41
  if not create_path.empty? then
41
- parent_path = (path.split('/') - create_path.reverse).join('/')
42
+
43
+ a = path.split('/').map {|x| x.to_i.to_s == x ? x.prepend('x') : x}
44
+ parent_path = (a - create_path.reverse).join('/')
42
45
  key_builder(parent_path, create_path)
43
46
  end
44
-
47
+
45
48
  add_value(path, value)
46
49
  end
47
50
 
@@ -199,20 +202,28 @@ class XMLRegistry
199
202
  private
200
203
 
201
204
  def add_key(path='app', key='untitled')
205
+
202
206
  node = @doc.root.element path
203
207
  r = node.add_element Rexle::Element.new(key)
204
208
  r
209
+
205
210
  end
206
211
 
207
212
  def add_value(key, value)
208
- @doc.root.element(key).text = value
213
+ s = key.split('/').map {|x| x.to_i.to_s == x ? x.prepend('x') : x}.join '/'
214
+ @doc.root.element(s).text = value
209
215
  end
210
216
 
211
217
  def find_path(path, create_path=[])
212
218
 
213
219
  return create_path if !@doc.root.xpath(path).empty?
214
220
  apath = path.split('/')
215
- create_path << apath.pop
221
+
222
+ x = apath.pop
223
+
224
+ x.prepend 'x' if x.to_i.to_s == x
225
+ create_path << x
226
+
216
227
  find_path(apath.join('/'), create_path)
217
228
  end
218
229
 
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.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -12,26 +12,26 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
14
  YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE0MDUyMTA4NDIzMVoXDTE1MDUyMTA4NDIzMVowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE2MDYxMzE4MjgzNFoXDTE3MDYxMzE4MjgzNFowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBANbuxvNO2DCw/rSlxULAkXHMDYF2Cygj6L4edsIBbYjR8wj5Yy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StvL7C38hqgQNlHqAeITwZvoTisqNBJztv89rnc89cwOaY
28
- u6vUHrfbE5fFF4tbd8BJvLM1JKrpQKNyf3lwuWH6M5sop6BVuHyDFBR+Mq8hvGGs
29
- 2gQnxM9WbaR1doRzqwsYpNjzM69ES6w1fgN3kQDw1+ARls3J970xV6+jgMZDeK+n
30
- Ma5r9plc6A6XGtWuZw3XRpyzkLBzxTgR1yAUnr5/GVdm9ZT4wSYJXgh1IVac9kbv
31
- OJamM7Bcj9+piGsKBJNnDsRMUDp9HTnzSQZQa6VGuC+B8wmTfyHedNg8nhA5omWj
32
- 01hmb/53blp2Mw==
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAzIDTewDd
27
+ gvQKAucu9rhOG1y35a/yMwbwL58PQshIo3NGAvORvSHtzf/ZfYq3LNVcUFIqyb7x
28
+ h5quowdNI4OYa1mU3EQFvA4cGp/8BQZ5wqW9dXPo6Y4xsEE675bY68yG2un3Sphj
29
+ X7WSvMFn42ZeV8n9GRhCI51uSXF6D56qi7kkaQQCbDaHHLhiwi3OQpokz2t5STzS
30
+ qe63jG18r3iHb27nzRZCQRv71SjCWzkpD9yE5RJU73g3FxTXLujUrtZHvw/kBKOj
31
+ 8NnTRE6giDgOSmiS3cUBa4NDAOa0G4FP3jSUGMylDswvYepLYk5XYONr9/0NQ66a
32
+ dQHXSvg1fTpm2Q==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-04-24 00:00:00.000000000 Z
34
+ date: 2016-06-13 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simple-config
@@ -39,20 +39,20 @@ dependencies:
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.5'
42
+ version: '0.6'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.5.0
45
+ version: 0.6.1
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '0.5'
52
+ version: '0.6'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.5.0
55
+ version: 0.6.1
56
56
  description:
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.6
83
+ rubygems_version: 2.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: xml-registry
metadata.gz.sig CHANGED
@@ -1,5 +1,4 @@
1
- jl�+ijj�|'3���ъ߅*]b�FB �����pV�t�A_�� �1����<]|� �.�,�����b��0�.!����v ��~�f�C�l"2�Qn�6G/s�1�{���
2
-
3
- I�D�^}�v�1��CrCa��pˬvxEu�m�p�A��3>��O�(ގ ��\����w˵Qq��|b#�S[Uθ���++�"ߥL��O�
4
-
5
- ��L@ ��zg��}���y-��X B���H�ǬH��i�
1
+ I_�V33�h��N=t����H\��.�Z��b��-���b
2
+ ҮN��CSlwհ_�l�ʭw�g��2�4W��{��h�{K�F�
3
+ ��H��g?͆_���D��.�]�ts~fNگ�⏢X��@� ��be,Clc�aG�����m`/�l���e��=��q�B�3�Bm����n����!�4Q �<���
4
+ B�>���a���KHYc3}&*��t��`��OwI�^��\q����9RŬ�@��T�����?n)