dynarex 0.7.3 → 0.7.4

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 +3 -3
  2. metadata +1 -1
@@ -88,11 +88,11 @@ EOF
88
88
  i = XPath.match(@doc.root, 'records/*/attribute::id').max_by(&:value).to_s.to_i
89
89
  t = @format_mask.to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
90
90
  lines = buffer.split(/\r?\n|\r(?!\n)/).map {|x|x.match(/#{t}/).captures}
91
-
91
+ fields = @format_mask.scan(/\[!(\w+)\]/).flatten.map(&:to_sym)
92
92
  a = lines.map do|x|
93
93
  created = Time.now.to_s
94
94
 
95
- h = Hash[@fields.zip(x)]
95
+ h = Hash[fields.zip(x)]
96
96
  [h[@default_key.to_s], {id: '', created: created, last_modified: '', body: h}]
97
97
  end
98
98
 
@@ -276,7 +276,7 @@ end))
276
276
  @default_key = XPath.first(@doc.root, 'summary/default_key/text()')
277
277
  @format_mask = XPath.first(@doc.root, 'summary/format_mask/text()')
278
278
 
279
- @fields = @format_mask.to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym) if @format_mask
279
+ #@fields = @format_mask.to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym) if @format_mask
280
280
 
281
281
  if @schema then
282
282
  @record_name, raw_fields = @schema.match(/(\w+)\(([^\)]+)/).captures
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: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors: []
7
7