dynarex-parser 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dynarex-parser.rb +8 -0
  2. metadata +2 -2
@@ -7,6 +7,14 @@ require 'rexleparser'
7
7
  class DynarexParser
8
8
 
9
9
  def initialize(s)
10
+
11
+ schema = s[/schema>([^<]+)/,1]
12
+ puts 'schema : ' + schema.inspect
13
+ record_name, raw_fields = schema.match(/(\w+)\(([^\(]+)\)$/).captures
14
+
15
+ error_found = raw_fields.split(',').include? record_name
16
+ raise "record name must not match a field name" if error_found
17
+
10
18
  @a = parse(s)
11
19
  end
12
20
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynarex-parser
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.9
5
+ version: 0.2.10
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-13 00:00:00 +01:00
13
+ date: 2012-05-05 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency