rowx 0.5.4 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +2 -5
- data.tar.gz.sig +0 -0
- data/lib/rowx.rb +21 -8
- metadata +32 -29
- metadata.gz.sig +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1517ea490ea6a6051ccd5bc0cecf01b07bfd0d20fbc5656f566bdaf7ef8005aa
|
4
|
+
data.tar.gz: bab6c43c96dd8baf5d28c941827eb68f65f850dee95143276d8eaddc1b63cb39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2098a609dc4edd3dbb7a0f234bd8cb0a93b75848545b53e587d1e7ede4940b3b72aff3d9215becbc4b83658652f1210c649167fe3534d963ed9da8811b741979
|
7
|
+
data.tar.gz: 5c5fb7a7d562c9c90ce6062eb411599e694193d8e3a231d142561912fdebebf92963192a9a3d1fd16d38311d87d4e114e5378786ef8f7abb3da2a33c5a3718b6
|
checksums.yaml.gz.sig
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
l
|
3
|
-
��*�ǫJ����;�]tM�Vi�l���D2�A5w� =��{Ϣ��ocv�����#�G
|
4
|
-
�o������n]+��b�RS�ƫUT���ߘ����b2�WJ zuCo�"�^�j��֤�1�,��YxX��B���ptu��� ��ș����Ԛ���z��P��P��/C��q�hN��_IP��X�Gh��.z���|����
|
5
|
-
��0
|
1
|
+
O��Վ��21J��:&ב��7-���{����6���)�L�!���`ز��q�H>��!)������sw�gah.�<�z�U�W��$
|
2
|
+
�����l���scI˓�9��$�6:���,��ѻ��q����(��I��y�b`Pl��G�3!�?G������B5��]���N���e���t�;�J$i`�)l����ϾS t�%F�U�Tm��&WB�1�3����t�H��ް��X:Z����5�y�=ͦ�1���KHިX��0Z2�=�0�bH����U.��V��e}��Z�q�z'9����}�����r�<Pr7�k��ՓH+�3�~�+�|�l��q�ڪe����E���g(n��$ζ$F�>�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rowx.rb
CHANGED
@@ -5,6 +5,9 @@
|
|
5
5
|
require 'line-tree'
|
6
6
|
|
7
7
|
|
8
|
+
class RowXException < Exception
|
9
|
+
end
|
10
|
+
|
8
11
|
# for an example of ArrayCollate
|
9
12
|
# see http://www.jamesrobertson.eu/snippets/2014/jun/08/collating-items-in-an-array.html
|
10
13
|
|
@@ -28,10 +31,14 @@ end
|
|
28
31
|
class RowX
|
29
32
|
|
30
33
|
using ArrayCollate
|
34
|
+
using ColouredText
|
31
35
|
|
32
36
|
attr_reader :to_a, :to_xml, :to_lines
|
33
37
|
|
34
|
-
def initialize(txt, level: nil
|
38
|
+
def initialize(txt, level: nil, ignore_blank_lines: false,
|
39
|
+
abort_1_row: false, debug: false, name: 'item')
|
40
|
+
|
41
|
+
@name, @debug = name, debug
|
35
42
|
|
36
43
|
# auto indent any multiline values
|
37
44
|
|
@@ -47,9 +54,12 @@ class RowX
|
|
47
54
|
end
|
48
55
|
|
49
56
|
end
|
57
|
+
|
58
|
+
puts 'lines: ' + lines.inspect if @debug
|
50
59
|
|
51
|
-
a = LineTree.new(lines.join, level: level,
|
52
|
-
|
60
|
+
a = LineTree.new(lines.join, level: level,
|
61
|
+
ignore_blank_lines: ignore_blank_lines, debug: debug).to_a
|
62
|
+
puts ('a: ' + a.inspect).debug if @debug
|
53
63
|
|
54
64
|
keyfield = a[0][0][/\w+:/]; i = 0
|
55
65
|
|
@@ -65,11 +75,14 @@ class RowX
|
|
65
75
|
|
66
76
|
keyfield = a[0][0][/\w+/] if i == a.length - 1
|
67
77
|
|
68
|
-
|
78
|
+
if a.flatten(1).grep(/^#{keyfield}/).length == 1 then # only 1 record
|
79
|
+
i = 0
|
80
|
+
raise RowXException, 'Expected more than 1 row' if abort_1_row
|
81
|
+
end
|
82
|
+
|
69
83
|
records = a[i..-1].collate { |x| x.first =~ /^#{keyfield }/ }
|
70
84
|
|
71
85
|
summary = scan_a a.slice!(0,i)
|
72
|
-
|
73
86
|
summary[0] = 'summary'
|
74
87
|
|
75
88
|
@rexle_a = scan_records(records, level)
|
@@ -93,7 +106,7 @@ class RowX
|
|
93
106
|
|
94
107
|
return if s.empty?
|
95
108
|
|
96
|
-
found = s.match(/^(\w+)
|
109
|
+
found = s.match(/^(\w+):(?:\s*|\n)(.*)/m)
|
97
110
|
|
98
111
|
value, name = found ? found.captures.reverse : s
|
99
112
|
name ||= 'description'
|
@@ -112,7 +125,7 @@ class RowX
|
|
112
125
|
result
|
113
126
|
end
|
114
127
|
|
115
|
-
[
|
128
|
+
[@name, {}, '' ] + a
|
116
129
|
end
|
117
130
|
|
118
131
|
def scan_records(rows, level)
|
@@ -121,4 +134,4 @@ class RowX
|
|
121
134
|
|
122
135
|
end
|
123
136
|
|
124
|
-
end
|
137
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rowx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUw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KPGO8OnFMg4dNh9owERjwy05ad5UditqQssYn4v3i7rAgGFMpajgV85fIu
|
30
|
+
Yk4HeZpwGT0Rh0puJX+lVcY4H+/0v/ilv6PQN1mnB+wdHp/wh4DcAbKoVntrVMKY
|
31
|
+
uSD00z/OGvu8Wt8cDoKKsvRx/M8+BA8Jh0d9rAbbD1wJxdO3dhr+xPe69rpzVQ0k
|
32
|
+
hHrQ2eQ6j5QceP2EbQAME42Sd+CIP8xT4HeAsUJWTqHGs0kiJvomHUTGe+JzBfke
|
33
|
+
CiKEYV1eq9T4rPX7hh9g+fvj66W5e/gJ6O+3fskNhzvP/lrnXPVs8ourOYI7Uoml
|
34
|
+
rP6fc4AahiTW5g9Yd93IIwivGQ1oRMfU15qn8AbxqV8hfbg8l8TqvJlh2vzyXZNb
|
35
|
+
800/1OqpheFJ2kxsgvkGfxh/3RV+ObACeZ/HSFCxStB23EvqS8umVWDkXA3qr3RB
|
36
|
+
yuZ4lODk6vzJbiDVh0MAHLnZ
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: line-tree
|
@@ -39,21 +43,21 @@ dependencies:
|
|
39
43
|
requirements:
|
40
44
|
- - "~>"
|
41
45
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
46
|
+
version: '0.9'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
49
|
+
version: 0.9.1
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
49
53
|
requirements:
|
50
54
|
- - "~>"
|
51
55
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0.
|
56
|
+
version: '0.9'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
56
|
-
description: Generates XML from rows of labelled text, nested text,
|
59
|
+
version: 0.9.1
|
60
|
+
description: Generates XML from rows of labelled text, nested text, and plain text
|
57
61
|
email: james@jamesrobertson.eu
|
58
62
|
executables: []
|
59
63
|
extensions: []
|
@@ -79,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
83
|
- !ruby/object:Gem::Version
|
80
84
|
version: '0'
|
81
85
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.6.8
|
86
|
+
rubygems_version: 3.0.3
|
84
87
|
signing_key:
|
85
88
|
specification_version: 4
|
86
89
|
summary: rowx
|
metadata.gz.sig
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
]
|
1
|
+
�["n�����~ ���
|
2
|
+
��/�z�W>�W�������A�Z�*�iED&�x-���w8�c�D�_������Z���U}�.��c~^��"#%���ƌ��o���3����k���ߋ�����ct�#'�c���m!�ձv���dsT.�=�_��Q[��y
|
3
|
+
ZR�
|
4
|
+
c�];�"��*��[�2�Iz����-jy�憇#JFRW�M��LH��O���R��H�l�2(U%�$�5��y�Q��6��U^i��q�ku�E���a*��%�n��lB�
|
5
|
+
}�Z�\�b�$VY�{nu�q͂��,P�-�X�#}�ũ����u�$�ǻ��ޛ�+{�'={u!��3��q�.�H%/
|