kvx 0.1.0 → 0.1.1
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 +1 -1
- data.tar.gz.sig +0 -0
- data/lib/kvx.rb +11 -2
- 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: d0b6d3e9a7fd408b42ac5756a736a6028e96a222
|
4
|
+
data.tar.gz: 115acbe562437a3301720914c12e74c54fead372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa0e5123d6bbb083f19ad1f97b4b28d4b032f764e765b1489e04c7d2066b85136cb225b3b4437e31a620dfde8f22deb93695af35d166c1deedda88906fbedb02
|
7
|
+
data.tar.gz: 5bde9d207ea769d4c2dc81a9dae99205aad796684ffefa3637a0d1b40da7d1a5a8222d6a391860058662ca1faee219852f439c7cd460e2f8c71b38a876d41edb
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
(?��t��n����'&�"��SN�oW���A��Ol-ݣ��i F�K憨��M#h|���c�1�,A�@�GOz`��j)� Ͻ�Z�H�u��@�$�%�1�!�4p���_``�R��7�QC)���1T��k���^��6��Y�s���s�q(ƫ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
|
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
|
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
metadata.gz.sig
CHANGED
Binary file
|