dynarex 1.2.31 → 1.2.32

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: 43ead0947536928464dc4dfce435aa84de0d3544
4
- data.tar.gz: b0780ccfa393fa0ffd377b14eb602fd68b7d717e
3
+ metadata.gz: 507bca865436dc06127d13236161cc493aba8ae8
4
+ data.tar.gz: 350b95e9f6bdd70e41813bbd2393b06dc67e41fe
5
5
  SHA512:
6
- metadata.gz: 2554422e1cafdd9666cf384c436c724a82636866995bd77631b535b67397a58811b3d56df68c8757d1db64c2201f8844f95ff07fde2183a71cc8cac2918b236f
7
- data.tar.gz: 4b80172746018dea4fd8611b19f1d868736391076fe162e3a2b7f52f0e347ec2980a0bcdb17bf6523588c2440896772d5d5538e92bbf9d5ac078980857c332f5
6
+ metadata.gz: 6d8c6eced93ca5964e271c3311402c9957a531f95001d4ef962fe4b23e6e49827b312a44f9cd8a1a3e714acf751448ec02ea8925ae5071f40ecbfed336d5a025
7
+ data.tar.gz: e0ebf7da9b89c6bb132a4b0a5c16cf45aff4f205020bce282c63b6285edcebdddacb8c282da0192f83dfcd750712b6e8320ad4b41c3a8b72d5119f5e5398b99f
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -587,8 +587,21 @@ EOF
587
587
  line << field.to_s + ':' if line.grep(/^#{field.to_s}:/).empty?
588
588
  end
589
589
  end
590
-
591
- xml = RowX.new(populated_lines.map{|x| x.join("\n")}.join("\n\n")).to_xml
590
+
591
+ #a3 = txt.split(/(?:\n|^\-+$)\n/)
592
+ a3 = populated_lines.map{|x| x.join("\n")}
593
+ # get the fields
594
+ a4 = a3.map{|x| x.scan(/\w+(?=:)/)}.flatten(1).uniq
595
+ a5 = a3.map do |xlines|
596
+
597
+ missing_fields = a4 - xlines.scan(/^\w+(?=:)/)
598
+ r = xlines.lines.map(&:strip)
599
+ r += missing_fields.map{|x| x + ":"}
600
+ r.sort.join("\n")
601
+
602
+ end
603
+
604
+ xml = RowX.new(a5.join("\n\n")).to_xml
592
605
  a2 = Rexle.new(xml).root.xpath('item').inject([]) do |r,x|
593
606
  r << @fields.map {|field| x.text(field.to_s) }
594
607
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.31
4
+ version: 1.2.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file