kvx 0.2.1 → 0.3.0

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -3
  3. data.tar.gz.sig +1 -2
  4. data/lib/kvx.rb +10 -7
  5. metadata +1 -1
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dda0bccf32b792dfdb62f62645b1f0e71d1d313
4
- data.tar.gz: bfe3aa2f41aeb8a050bb8558ebf4e6fa0f6a02e3
3
+ metadata.gz: b505b5c13d62100140d9c7cdd00772fcdda1be48
4
+ data.tar.gz: 2ceec413f42836ad5e21fa39868ddd5e4bcd5498
5
5
  SHA512:
6
- metadata.gz: 02b2d88b029cf1bc1ee942f3397d554f851abe6272c3c73b458896522dbe895b1e9ae80e5e7100a06dc7a9d0d7030d5030ae9368cfa6da08070c12aa167a4446
7
- data.tar.gz: 224d86a8a16b33a0bf89c7d87cda6c3ee281c5565ca64f8ea7d7d3bff5f3cb11af4df38a6edbda823c6d07ac0c31968c92abe794ee55b6f933e459e5b599291e
6
+ metadata.gz: b9c99fc02d2243c0dad0de86ce83c562b96cdb39b13577b7529cfd07405bd90e4bcb02a2de540cc78da40faf26a9e455d5ea73d4a73f884754d62fa92b77c9a2
7
+ data.tar.gz: f2a95a0abd526045bdff0b5703fb65d2c87f895ef04c1aa8ed6547f4b0bbc5610488c38f058e4a2258fb4e8d1a64646617e065c19b29cd59cbf1bcc5ea2e9204
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- 7����a9�݈��������u���rFSs�/��Wv��G>��E!h�/��xF N*�e|^�Go\�
2
- R���=��W#�$W�Ⱦ�g��w�L�#m�-��˜(�yj�3ƙ.���'���r�l`��TQ�V��`Yؽ7��� 7dh��iӉ����#�L��_������d>��!w,��kuJyP����mD��ܜJ�;�7Q��Ѓ'��!>��:xiX�ꩍ���Q
3
- �P�=�o�Q?�#����V
1
+ R�/Af_�%s���@��l���-�HWrt��qH2�/��oc�ᇜm;���Q7�lX�`�ˮ������if��=��âv�it���4o\�OO^
2
+ �pBR�ʔ���so��:\Q���L��#���W��wh���b����C���V*� ��Q��� -�й����L�ms?T{\�����̒+tة `��G��d_�jz==Ajw��fR�)�%��R�rJ>hѶHM�EJ#� q+YQ��0:
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ]Ԁ��$���P Vn$ZT,�7SS,�*��>$9��P������ )�>�%{v���$#��9OLG��
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$VbY��zſC�!�,�k����W� ����mܹ�B�݁�b���@G z��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: :parse_to_h}
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kvx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file