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.
Files changed (2) hide show
  1. data/lib/dynarex.rb +11 -7
  2. metadata +1 -1
@@ -370,17 +370,21 @@ EOF
370
370
  t = @format_mask.to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
371
371
  end
372
372
 
373
- a_summary = schema[/\[([^\]]+)/,1].split(',').map(&:strip)
374
- raw_lines = buffer.strip.split(/\r?\n|\r(?!\n)/)
373
+ raw_summary = schema[/\[([^\]]+)/,1]
375
374
 
376
- @summary = {}
377
- while raw_lines.first[/#{a_summary.join('|')}:\s+\w+/] do
378
- label, val = raw_lines.shift.match(/(\w+):\s+([^$]+)$/).captures
379
- @summary[label] = val
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
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.11
5
+ version: 1.1.12
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson