xml-registry 0.3.1 → 0.4.2

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: ecdbe12a98ab7abc435d01e99d479e5e30e34545
4
- data.tar.gz: cfdbe68ee5795daeb00b29aafb99be16bb404464
3
+ metadata.gz: e801a172eedccefac1aa7769c889e58d7a498110
4
+ data.tar.gz: 0f0b8c936dab5643f24cb79c61e3f611f9fa5a1b
5
5
  SHA512:
6
- metadata.gz: 433650c49a10a3822f7fd7f4b9b4a3abeda2d103e26adead9e1413da4579797be41f6e32a6396776afdfe152454510f1eeb97387b8ac324e52600f1a61de37ee
7
- data.tar.gz: 126a11d7d4ef8dda2bcdc92817054bb7c5bfedfedd4907fdc3125d1e62579a2e7df33203bee845c5f24bb5f812d3d725b5969f298862af16aeebca88e7e88d0b
6
+ metadata.gz: b9698ba61797de05701997566f4c759041d246ab49fbca7cbcf1ba177f3e4f159b51c44cecf5e3e98fbd2dd9665267a97236de8aac219fd1e9f3d477013caf57
7
+ data.tar.gz: 1661769a5f0e5f5e797d2ab7db1372ddedd3fc67a1d55102ea0a6a352b4137858875e3a445ee4bbc9617588f3f8e49422da291828470e9b53b00edfb684a32b3
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/xml-registry.rb CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  # file: xml-registry.rb
4
4
 
5
- require 'rexle'
5
+ #require 'rexle'
6
6
  require 'rxfhelper'
7
+ require 'simple-config'
7
8
 
8
9
 
9
10
  class XMLRegistry
@@ -54,13 +55,36 @@ class XMLRegistry
54
55
  # returns the value as a Rexle::Element
55
56
  #
56
57
  def get_key(path)
58
+
57
59
  key = @doc.root.element path
58
60
  raise ("xml-registry: key %s not found" % path) unless key
61
+
62
+ key.instance_eval {
63
+ @path = path
64
+
65
+ def hashify(e)
66
+
67
+ v = if e.has_elements? then
68
+ e.elements.inject({}) do |r, x|
69
+ r.merge hashify(x)
70
+ end
71
+ else
72
+ e.text
73
+ end
74
+
75
+ {e.name => v}
76
+ end
77
+
78
+ def to_config()
79
+ SimpleConfig.new(hashify(self), attributes: {key: @path})
80
+ end
81
+ }
82
+
59
83
  key
60
84
  end
61
85
 
62
86
  # get several keys using a Rexle XPath
63
- # example: get_key('//funday') #=> [<funday>tuesday</funday>,<funday>friday</funday>]
87
+ # example: get_keys('//funday') #=> [<funday>tuesday</funday>,<funday>friday</funday>]
64
88
  #
65
89
  # returns an array of 0 or more Rexle elements
66
90
  #
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- {6_}���g>�n��'�ȫ�>!)�9<78W�s��/,�q��y?���,σx �2��P��-��wtoo�f�El��spcs�|h�]�f)��6��U���<0�H����U�c�$��[4^Ig\��*��>�9jn������%¯��H��ne^�Օ��� 9�Nՙ��U�\�t���O�Hu��l ���.w���(���`Rle("�@�B�� uo��+��vH6��n�
2
- 3�>���_E�+��f
1
+ �ғ]�?na�\��ٳr���5؂V�Ħ�Їy�@;�^�e$-���_��/��f�3G�c[���)6m��X�
2
+ �����u��ܧ�JM��lT!zY�5��XyUN&� ���`p����“��oN��F�Z:ox��֤;�T
3
+ ����zk�g�u+��^�'(Y�n�!�
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.3.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,28 +31,28 @@ cert_chain:
31
31
  OJamM7Bcj9+piGsKBJNnDsRMUDp9HTnzSQZQa6VGuC+B8wmTfyHedNg8nhA5omWj
32
32
  01hmb/53blp2Mw==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-11-27 00:00:00.000000000 Z
34
+ date: 2015-04-23 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
- name: rexle
37
+ name: simple-config
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '1.0'
42
+ version: '0.4'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.0.11
45
+ version: 0.4.2
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: '1.0'
52
+ version: '0.4'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.0.11
55
+ version: 0.4.2
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rxfhelper
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.2.2
103
+ rubygems_version: 2.4.6
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: xml-registry
metadata.gz.sig CHANGED
@@ -1 +1,3 @@
1
- V��#�\�6tCU�6�a��:��f!E�Ƚi,uRyP*w(���a@�tP��6����^ڠ=���)\�+[���
1
+ �Qj��iOP.�u���2[�Lzն+���{�od�qT��b[L-U؋�:v����� *FB�+a��Q�1��Y��"icu��?��i������*���� wM����>�%�
2
+ -td
3
+ �_#c�A\�\�D��| ��VT�tY�����4���e��^���6��^��W�f�S�5����6�>�J���?�O���mV��3�3Ȱ�ZG�-�zz�j��Lǚ8���~�߽�� (V�hvi��