kvx 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -3
- data.tar.gz.sig +1 -2
- data/lib/kvx.rb +10 -7
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b505b5c13d62100140d9c7cdd00772fcdda1be48
|
4
|
+
data.tar.gz: 2ceec413f42836ad5e21fa39868ddd5e4bcd5498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9c99fc02d2243c0dad0de86ce83c562b96cdb39b13577b7529cfd07405bd90e4bcb02a2de540cc78da40faf26a9e455d5ea73d4a73f884754d62fa92b77c9a2
|
7
|
+
data.tar.gz: f2a95a0abd526045bdff0b5703fb65d2c87f895ef04c1aa8ed6547f4b0bbc5610488c38f058e4a2258fb4e8d1a64646617e065c19b29cd59cbf1bcc5ea2e9204
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
3
|
-
�P�=�o�Q?�#����V
|
1
|
+
R�/Af_�%s���@��l���-�H�Wr�t��qH�2�/��oc�ᇜm;���Q�7�lX�`�ˮ������if��=��âv�it���4o\�OO^
|
2
|
+
�pBR�ʔ���so��:\Q���L��#���W��wh���b����C���V*� ��Q���-�й����L�ms?T{\�����̒+tة`��G��d_�j�z==A�jw��fR�)�%��R�rJ>hѶHM�EJ#� q+YQ��0:
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
]
|
2
|
-
�p�9ƹ8��������_�т�c6ՍI��,�5ԃ�$K���i�f��^U������o�⡝Q�Q�"���Y{_�,M�JK%�I������B�z��|�r��4�5NkJQ��rCyA\,Y�Y_�3/UTQ���|��/H�ݟ�
|
1
|
+
[Ȃ�B���*y�c��%�W���]Ep`�I�\�~���^�KR]$�Ѥ�L#�;�[���⠗�A̡d�/wXfIo��ڲ���)�Q�kh�F���E�HC.�G��t$Vb�Y��zſC�!�,�k����W�����mܹ�B�݁�b���@Gz��P����%S�f�=d���r y�T�R��qS ��-�S/F��=��l�U]vE.@;x�v~TU��XP+��ЃB#��9A�a`g��7
|
data/lib/kvx.rb
CHANGED
@@ -18,11 +18,11 @@ class Kvx
|
|
18
18
|
attr_reader :to_h
|
19
19
|
|
20
20
|
def initialize(x, attributes: {})
|
21
|
-
|
21
|
+
|
22
22
|
@header = false
|
23
23
|
@identifier = 'kvx'
|
24
24
|
@attributes = attributes
|
25
|
-
h = {hash: :passthru, :'rexle::element' => :hashify, string: :
|
25
|
+
h = {hash: :passthru, :'rexle::element' => :hashify, string: :parse_string}
|
26
26
|
@h = method(h[x.class.to_s.downcase.to_sym]).call x
|
27
27
|
|
28
28
|
end
|
@@ -30,10 +30,6 @@ class Kvx
|
|
30
30
|
def item()
|
31
31
|
@h
|
32
32
|
end
|
33
|
-
|
34
|
-
def parse(t=nil)
|
35
|
-
parse_to_h(t || @to_s)
|
36
|
-
end
|
37
33
|
|
38
34
|
def to_h()
|
39
35
|
deep_clone @h
|
@@ -117,6 +113,13 @@ class Kvx
|
|
117
113
|
|
118
114
|
end
|
119
115
|
end
|
116
|
+
|
117
|
+
def parse_string(s)
|
118
|
+
|
119
|
+
buffer, type = RXFHelper.read(s)
|
120
|
+
type == :xml ? hashify(buffer) : parse_to_h(buffer)
|
121
|
+
|
122
|
+
end
|
120
123
|
|
121
124
|
def parse_to_h(s, header_pattern: %r(^<\?kvx[\s\?]))
|
122
125
|
|
@@ -147,7 +150,7 @@ class Kvx
|
|
147
150
|
end
|
148
151
|
|
149
152
|
def passthru(x)
|
150
|
-
x
|
153
|
+
deep_clone x
|
151
154
|
end
|
152
155
|
|
153
156
|
def pretty_print(a, indent='')
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|