rowx 0.1.5 → 0.1.6
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 +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rowx.rb +2 -15
- 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: d1faf6450bc1d691aa93c1e0142f79892360def2
|
4
|
+
data.tar.gz: 3ed1d6842b40b0e395dc076b79c1e8880659781a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cd1a8b805f158cb61b8c959f44373db8780228e28a411361313c8c20e5ed46a4c51ad59c70648527c7df968b4bb96070de36dcbf9026e971a5e56e1ee65b827
|
7
|
+
data.tar.gz: eda5154662b74f47249854519607e939d80b76ad0e4f531ceb66332ee7c9d0497a926d168d6857ca7705c00567072b17f8b6c1994c51aca80239dcc1d87bc2e7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rowx.rb
CHANGED
@@ -26,20 +26,7 @@ class RowX
|
|
26
26
|
|
27
27
|
def initialize(txt)
|
28
28
|
|
29
|
-
|
30
|
-
# get the fields
|
31
|
-
a4 = a3.map{|x| x.scan(/\w+(?=:)/)}.flatten(1).uniq
|
32
|
-
a5 = a3.map do |xlines|
|
33
|
-
|
34
|
-
missing_fields = a4 - xlines.scan(/^\w+(?=:)/)
|
35
|
-
r = xlines.lines.map(&:strip)
|
36
|
-
r += missing_fields.map{|x| x + ":"}
|
37
|
-
r.sort.join("\n")
|
38
|
-
|
39
|
-
end
|
40
|
-
a6 = a5.join("\n\n")
|
41
|
-
|
42
|
-
a = LineTree.new(a6).to_a
|
29
|
+
a = LineTree.new(txt.gsub(/^-*$/m,'')).to_a
|
43
30
|
|
44
31
|
keyfield = a[0][0][/\w+/]; i = 0
|
45
32
|
|
@@ -53,7 +40,7 @@ class RowX
|
|
53
40
|
summary = scan_a a.slice!(0,i)
|
54
41
|
|
55
42
|
summary[0] = 'summary'
|
56
|
-
@to_a = ['root', '', {}] + [summary] + scan_records(records)
|
43
|
+
@to_a = ['root', '', {}] + [summary] + scan_records(records)
|
57
44
|
@to_xml = Rexle.new(@to_a).xml pretty: true
|
58
45
|
|
59
46
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|