rowx 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a367896f310d110e34515571524f069b65397f7
4
- data.tar.gz: c3335372d9a21754445b206ba1a99af51824e089
3
+ metadata.gz: d1faf6450bc1d691aa93c1e0142f79892360def2
4
+ data.tar.gz: 3ed1d6842b40b0e395dc076b79c1e8880659781a
5
5
  SHA512:
6
- metadata.gz: 132d7b2b03b8aae5b88fb4f0028265ec59103c315bdb20108620454b48a6e8cdd7fd16706efefa2e958af5e21df3b99a01293d1398a78ef8e93395cb57da2bc6
7
- data.tar.gz: e7f64ce9e1e41a52b7d08692399c6407ab12a8fa449aae31b8360d68a9324f84d4dfeedbdc4624153190a2e0f72dcf42a863702cea346f3241ad09ff94f35f05
6
+ metadata.gz: 5cd1a8b805f158cb61b8c959f44373db8780228e28a411361313c8c20e5ed46a4c51ad59c70648527c7df968b4bb96070de36dcbf9026e971a5e56e1ee65b827
7
+ data.tar.gz: eda5154662b74f47249854519607e939d80b76ad0e4f531ceb66332ee7c9d0497a926d168d6857ca7705c00567072b17f8b6c1994c51aca80239dcc1d87bc2e7
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -26,20 +26,7 @@ class RowX
26
26
 
27
27
  def initialize(txt)
28
28
 
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
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
@@ -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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file