dynarex 1.1.22 → 1.1.23

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 +4 -14
  2. metadata +2 -2
@@ -348,24 +348,15 @@ EOF
348
348
 
349
349
  if raw_header then
350
350
  header = raw_header[/<?dynarex (.*)?>/,1]
351
- header.scan(/\w+\="[^"]+\"/).map{|x| r = x.split(/=/); [(r[0] + "=").to_sym, r[1][/^"(.*)"$/,1]] }.each {|name, value| self.method(name).call(value)}
351
+ header.scan(/\w+\="[^"]+\"/).map\
352
+ {|x| r = x.split(/=/,2); [(r[0] + "=").to_sym, \
353
+ r[1][/^"(.*)"$/,1]] }.each \
354
+ {|name, value| self.method(name).call(value)}
352
355
  end
353
356
 
354
357
  # if records already exist find the max id
355
358
  i = @doc.root.xpath('max(records/*/attribute::id)').to_i
356
-
357
359
 
358
- # 'a' and 'a_split' just used for validation
359
- a = @format_mask.scan(/\[!\w+\]/)
360
- a_split = @format_mask.split(/\[!\w+\]/)
361
-
362
- if a.length == 2 and a_split[1].length == 1 then
363
- t = "([^#{a_split[1]}]+)" + a_split[1] + "(.*)"
364
- else
365
- # convert the format mask into a friendly reg exp string
366
- t = @format_mask.to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
367
- end
368
-
369
360
  raw_summary = schema[/\[([^\]]+)/,1]
370
361
  raw_lines = buffer.strip.split(/\r?\n|\r(?!\n)/)
371
362
 
@@ -471,7 +462,6 @@ EOF
471
462
  end
472
463
 
473
464
  @doc = Rexle.new(buffer) unless @doc
474
-
475
465
  @schema = @doc.root.text('summary/schema')
476
466
  @root_name = @doc.root.name
477
467
  @summary = summary_to_h
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.22
5
+ version: 1.1.23
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-26 00:00:00 +01:00
13
+ date: 2012-05-07 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency