dynarex 1.1.11 → 1.1.12
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.
- data/lib/dynarex.rb +11 -7
- metadata +1 -1
data/lib/dynarex.rb
CHANGED
@@ -370,17 +370,21 @@ EOF
|
|
370
370
|
t = @format_mask.to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
|
371
371
|
end
|
372
372
|
|
373
|
-
|
374
|
-
raw_lines = buffer.strip.split(/\r?\n|\r(?!\n)/)
|
373
|
+
raw_summary = schema[/\[([^\]]+)/,1]
|
375
374
|
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
375
|
+
if raw_summary then
|
376
|
+
a_summary = raw_summary.split(',').map(&:strip)
|
377
|
+
raw_lines = buffer.strip.split(/\r?\n|\r(?!\n)/)
|
378
|
+
|
379
|
+
@summary = {}
|
380
|
+
while raw_lines.first[/#{a_summary.join('|')}:\s+\w+/] do
|
381
|
+
label, val = raw_lines.shift.match(/(\w+):\s+([^$]+)$/).captures
|
382
|
+
@summary[label] = val
|
383
|
+
end
|
380
384
|
end
|
385
|
+
|
381
386
|
lines = raw_lines.map {|x|x.strip.match(/#{t}/).captures}
|
382
387
|
|
383
|
-
|
384
388
|
a = lines.map do|x|
|
385
389
|
created = Time.now.to_s
|
386
390
|
|