kvx 0.1.0 → 0.1.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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +1 -1
  3. data.tar.gz.sig +0 -0
  4. data/lib/kvx.rb +11 -2
  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: 817907abde6224e0927fadce5e3b6ff45bf170a5
4
- data.tar.gz: 745afaaf9215927f7c19e739d39f9f27921e92dc
3
+ metadata.gz: d0b6d3e9a7fd408b42ac5756a736a6028e96a222
4
+ data.tar.gz: 115acbe562437a3301720914c12e74c54fead372
5
5
  SHA512:
6
- metadata.gz: 7b7bb78ebed825fdb6fbd24bc2ba7e06ad1f8484508c11ebe3a464f49eaa1ba1a3447380940d3f769b18408397a02e4337479ef336b932211d9f0657642b0d5e
7
- data.tar.gz: 479af80eead59e44f79dee501438d036e9504db8af590981b97dd0793a0609d9a4a12358ab1be5ee646dc77a4cceda5c1feca5c13ac76d36a14a27eb6aecd6cc
6
+ metadata.gz: fa0e5123d6bbb083f19ad1f97b4b28d4b032f764e765b1489e04c7d2066b85136cb225b3b4437e31a620dfde8f22deb93695af35d166c1deedda88906fbedb02
7
+ data.tar.gz: 5bde9d207ea769d4c2dc81a9dae99205aad796684ffefa3637a0d1b40da7d1a5a8222d6a391860058662ca1faee219852f439c7cd460e2f8c71b38a876d41edb
@@ -1 +1 @@
1
- 54y�0\F|[���a���-����1�X3o���|C�=߈ �e��1t�<���̙�03�Bf�'�l���!�����\������� eK\9�A�^̸{���~o����Xȃ�@�?'<T״R9-��9`����������������SQF'���+uO���~��$���`��wbL��X�;�^�7��Dd�)�$�t�)Y;Ku;�+��=��OQp`��d���p��j6m�~�*��'�|
1
+ (?��t��n����'&�"��SNoW���A��Ol-ݣ��i FK憨��M# h|���c1�,A�@�GOz`��j)� Ͻ�Z�Hu��@�$�׎%�1�!�4p���_``�R��7�QC)���1T��k���^��6 ��Y�s���sq(ƫR
data.tar.gz.sig CHANGED
Binary file
data/lib/kvx.rb CHANGED
@@ -20,7 +20,7 @@ class Kvx
20
20
  def initialize(x, attributes: {})
21
21
 
22
22
  @attributes = attributes
23
- h = {hash: :passthru, rexle: :hashify, string: :parse_to_h}
23
+ h = {hash: :passthru, :'rexle::element' => :hashify, string: :parse_to_h}
24
24
  @to_h = method(h[x.class.to_s.downcase.to_sym]).call x
25
25
 
26
26
  end
@@ -78,7 +78,7 @@ class Kvx
78
78
  end
79
79
  end
80
80
 
81
- def parse_to_h(s, header_pattern=%r(^<\?kvx[\s\?]))
81
+ def parse_to_h(s, header_pattern: %r(^<\?kvx[\s\?]))
82
82
 
83
83
  raw_txt, _ = RXFHelper.read(s)
84
84
 
@@ -101,6 +101,15 @@ class Kvx
101
101
  x
102
102
  end
103
103
 
104
+ def pretty_print(a, indent='')
105
+
106
+ a.map do |x|
107
+ (x.is_a?(String) or x.nil?) ? x.to_s : pretty_print(x, indent + ' ')
108
+ end.join("\n" + indent)
109
+
110
+ end
111
+
112
+
104
113
  def scan_to_h(txt)
105
114
 
106
115
  raw_a = LineTree.new(txt.gsub(/(^-*$)|(#.*)/,'').strip,
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file