rowx 0.4.1 → 0.4.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rowx.rb +8 -3
- metadata +3 -3
- 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: 69d15e7558e393aeb06f8a710bf6ac7fadadf343
|
4
|
+
data.tar.gz: 4d17a0ce28ecdb5a035799da40e645f8048a05de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c49084f7b1beed688c14c54de9a161a57fa0c48518866b272890c66fbbb2ff110526d520f3e462e43ef713a8fe3fb512660b878a66973e3c309915139d6b320
|
7
|
+
data.tar.gz: 2c4d4fdcb105f3d65948ed05867d88eda29672297575e2dcad033931cb67c7f5c16a8edb19e584f91a6addf01674665963a4f8dbdc945f0f3ad3c769660a84f2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rowx.rb
CHANGED
@@ -28,20 +28,25 @@ class RowX
|
|
28
28
|
|
29
29
|
a = LineTree.new(txt.gsub(/^-*$/m,''), \
|
30
30
|
level: level, ignore_blank_lines: false).to_a
|
31
|
+
|
31
32
|
keyfield = a[0][0][/\w+:/]; i = 0
|
32
33
|
|
33
34
|
# find the keyfield. if there's only 1 keyfield in all of the rows it's
|
34
35
|
# not a keyfield. Keep searching until all rows have been searched
|
35
|
-
while a.select {|x| x[0][/^#{keyfield}/]}.length <= 1 and
|
36
|
+
while a.select {|x| x[0][/^#{keyfield}/]}.length <= 1 and \
|
37
|
+
i < a.length and a[i+1]
|
38
|
+
|
36
39
|
i += 1
|
37
|
-
keyfield = a[i][0][/\w+/]
|
38
|
-
|
40
|
+
keyfield = a[i][0][/\w+/]
|
41
|
+
|
42
|
+
end
|
39
43
|
|
40
44
|
keyfield = a[0][0][/\w+/] if i == a.length - 1
|
41
45
|
records = a[i..-1].collate { |x| x.first =~ /^#{keyfield }/ }
|
42
46
|
summary = scan_a a.slice!(0,i)
|
43
47
|
|
44
48
|
summary[0] = 'summary'
|
49
|
+
|
45
50
|
@to_a = ['root', {}] + [summary] + scan_records(records, level)
|
46
51
|
|
47
52
|
@to_xml = Rexle.new(@to_a).xml pretty: true
|
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.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
yaP43m5g1gqUfr6ys6w86uiM1Khmw6RXdAZBrQU+jmXYRU0OejB3+MdhPte5gP6n
|
32
32
|
k3UhzyiVjlkLhQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: line-tree
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.4.8
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: rowx
|
metadata.gz.sig
CHANGED
Binary file
|