rowx 0.1.4 → 0.1.5
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/lib/rowx.rb +15 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 5a367896f310d110e34515571524f069b65397f7
|
4
|
+
data.tar.gz: c3335372d9a21754445b206ba1a99af51824e089
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 132d7b2b03b8aae5b88fb4f0028265ec59103c315bdb20108620454b48a6e8cdd7fd16706efefa2e958af5e21df3b99a01293d1398a78ef8e93395cb57da2bc6
|
7
|
+
data.tar.gz: e7f64ce9e1e41a52b7d08692399c6407ab12a8fa449aae31b8360d68a9324f84d4dfeedbdc4624153190a2e0f72dcf42a863702cea346f3241ad09ff94f35f05
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rowx.rb
CHANGED
@@ -26,7 +26,20 @@ class RowX
|
|
26
26
|
|
27
27
|
def initialize(txt)
|
28
28
|
|
29
|
-
|
29
|
+
a3 = txt.split(/(?:\n|^\-+$)\n/)
|
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
|
30
43
|
|
31
44
|
keyfield = a[0][0][/\w+/]; i = 0
|
32
45
|
|
@@ -40,7 +53,7 @@ class RowX
|
|
40
53
|
summary = scan_a a.slice!(0,i)
|
41
54
|
|
42
55
|
summary[0] = 'summary'
|
43
|
-
@to_a = ['root', '', {}] + [summary] + scan_records(records)
|
56
|
+
@to_a = ['root', '', {}] + [summary] + scan_records(records)
|
44
57
|
@to_xml = Rexle.new(@to_a).xml pretty: true
|
45
58
|
|
46
59
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
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.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
uXUwmNalFJIXxQzr4trZWuBNI64wIqhFnjEQHG2N9HUyaGwkK5TznpUM8KEqDnDk
|
30
30
|
fXbCnu8uH0gz42PqnrqiE7yzaUNWh3VM
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2013-07
|
32
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: line-tree
|
metadata.gz.sig
CHANGED
Binary file
|