simple-config 0.4.0 → 0.4.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.tar.gz.sig +2 -4
- data/lib/simple-config.rb +19 -3
- metadata +1 -1
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6f580398dfac278daa0ae860c7a0374e15a24b6
|
|
4
|
+
data.tar.gz: 200900916214c116d4e874f91d1d3b59d400bc97
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c89a8140bfa7776b0c058980e61dd8c5f86e9d3a71b35c52857e1b0c1dd9ff547ef18e46e78774335e8c4b274ba9cd7181a45a3bdb4b07eeca4c81c5afcda90
|
|
7
|
+
data.tar.gz: 4eec4f72ed2fa715bd3523349cbf7befa30facedbc5f189d90c49c210da433ca72b3c2359aa1351aa0e44f5dc2d9c2e1b215f22e77160f4f096905853e66287f
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
,�*q�ϰ��
|
|
4
|
-
���
|
|
1
|
+
�nW��ur�m�5D-������>'�L�UR�s�v���2PG%,�`��p$�H��7ČL��Hoδ�M�GHF��Yp��{/\�5a��n�v������I�*�u�R�N~��}s����J�������iR���sggV�!����i��B�
|
|
2
|
+
����J��F1u�� ?��j�gH�:�j��9Lf�YX7a2�G��;��sk�Į�(`�T6�����їb7Q�B��}�L�W�]�(n�}E�O?
|
data/lib/simple-config.rb
CHANGED
|
@@ -38,11 +38,27 @@ class SimpleConfig
|
|
|
38
38
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
def to_xml()
|
|
42
|
-
|
|
41
|
+
def to_xml(options={pretty: true})
|
|
42
|
+
|
|
43
|
+
make_xml(@to_h)
|
|
44
|
+
|
|
45
|
+
attributes = @type ? {type: @type} : {}
|
|
46
|
+
a = ['simpleconfig', attributes, '', *make_xml(@to_h)]
|
|
47
|
+
Rexle.new(a).xml(options)
|
|
48
|
+
|
|
43
49
|
end
|
|
44
50
|
|
|
45
51
|
private
|
|
52
|
+
|
|
53
|
+
def make_xml(h)
|
|
54
|
+
|
|
55
|
+
h.map do |name, x|
|
|
56
|
+
|
|
57
|
+
value = x.is_a?(Hash) ? make_xml(x) : x
|
|
58
|
+
[name, {}, *value]
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
46
62
|
|
|
47
63
|
def parse_to_h(s)
|
|
48
64
|
|
|
@@ -151,4 +167,4 @@ class SimpleConfig
|
|
|
151
167
|
@to_s = a.join("\n")
|
|
152
168
|
end
|
|
153
169
|
|
|
154
|
-
end
|
|
170
|
+
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Mz��������!���քu��Ng�{Z���q�ҙ&��Ai[|kE=��Ih��~2�����h�К3�7�������3~��Er�,�^7��?�7�Nh�-&�L�oy`���V�S���7�v
|