polyrex 0.8.34 → 0.8.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f22bfea02d697da5897d487fe3174e92b1505f9f
4
- data.tar.gz: e2381385c4388dc4c40e612d219aa15b38a9a97d
3
+ metadata.gz: 57ff9750c2b16ed4928b43bf543af269d642448e
4
+ data.tar.gz: 7a344815c39c0cf52e2d15ec6f8c4a2126eff871
5
5
  SHA512:
6
- metadata.gz: 37f84775b83c3fc0c4d9e0a6056b9764adb3525f888eaaa8199cc74e7e9f15435dd4a7fdf9b1131938d0d703ab58259d6b5b899075b79bde81e319ce5fc93dbf
7
- data.tar.gz: e62a494eff2b7e6a6a12544d3974e5a4176e7f2458e0a5521449c227b8792569a62ce83b37bc2a7cf15e7bb521f862fc1a3900c6f149fa0aafd9cee4b628b9e1
6
+ metadata.gz: 596141d1b84122f171e7c3bba8be8f2633501025757494cde9b86af04d6dc61e9f86982788b41f31cdf44df6351c3a35119e52d93918d48bc3b358d0ca81cd81
7
+ data.tar.gz: 37f2e9f7380beffd4e2b7a04e41f3cf3ed8d02bf35b674ebf9c39603f31fdad93cab7295fe21b3031057fee0fbe73297aac6a65cd3a1fdedb7257d295ec245a8
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/polyrex.rb CHANGED
@@ -326,8 +326,10 @@ EOF
326
326
  end
327
327
 
328
328
  @summary.format_mask = @format_masks
329
-
330
- format_line!(@parent_node.element('summary'), @parent_node.root, LineTree.new(raw_lines.join("\n").strip).to_a)
329
+ records = @parent_node.root
330
+ @parent_node = records.parent
331
+ records.delete
332
+ @parent_node.root.add format_line!( LineTree.new(raw_lines.join("\n").strip).to_a)
331
333
 
332
334
  end
333
335
 
@@ -342,7 +344,9 @@ EOF
342
344
  attach_edit_handlers(@objects)
343
345
  end
344
346
 
345
- def format_line!(summary, records, a, i=0)
347
+ def format_line!(a, i=0)
348
+
349
+ records = Rexle::Element.new('records')
346
350
 
347
351
  a.each do |x|
348
352
 
@@ -376,13 +380,14 @@ EOF
376
380
  summary.add ynode
377
381
  next
378
382
  end
379
-
383
+
380
384
  unless @format_masks[i][/^\(.*\)$/] then
381
-
382
- @field_names, field_values = RXRawLineParser.new(format_masks[i]).parse(line)
385
+
386
+ @field_names, field_values = RXRawLineParser.new(format_masks[i])\
387
+ .parse(line)
383
388
 
384
389
  else
385
-
390
+
386
391
  format_masks = @format_masks[i][1..-2].split('|')
387
392
  patterns = format_masks.map do |x|
388
393
  regexify_fmask(x) #.sub(/\[/,'\[').sub(/\]/,'\]')
@@ -391,7 +396,8 @@ EOF
391
396
  pattern = patterns.detect {|x| line.match(/#{x}/)}
392
397
  i = patterns.index(pattern)
393
398
 
394
- @field_names = format_masks[i].to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym)
399
+ @field_names = format_masks[i].to_s.scan(/\[!(\w+)\]/)\
400
+ .flatten.map(&:to_sym)
395
401
 
396
402
  field_values = line.match(/#{pattern}/).captures
397
403
 
@@ -415,19 +421,21 @@ EOF
415
421
  end
416
422
 
417
423
  format_mask = @format_masks[i]
424
+
418
425
  if @type == 'checklist' then
419
426
  format_mask = format_mask.sub(/999999999/,' ')
420
427
  end
428
+
421
429
  summary.add Rexle::Element.new('format_mask').add_text(format_mask)
422
430
 
423
- new_records = Rexle::Element.new('records')
424
-
425
431
  record.add summary
426
- record.add new_records
432
+ child_records = format_line!(x, i+1) unless x.empty?
433
+
434
+ record.add child_records
427
435
  records.add record
428
-
429
- format_line!(summary, new_records, x, i+1) unless x.empty?
430
436
  end
437
+
438
+ records
431
439
  end
432
440
 
433
441
  # -- end of full text edit methods
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.34
4
+ version: 0.8.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  7hfiCsNv+0o/OwBNlpn8pTTpd3jV6o1Qq0Y7QiFomKd6XWlaHT4ZNtZdb/XTpC7W
30
30
  ZUZv+oXV5L4FrLlOrnTUhA+cZRntSyHs
31
31
  -----END CERTIFICATE-----
32
- date: 2013-09-24 00:00:00.000000000 Z
32
+ date: 2013-11-09 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: polyrex-schema
metadata.gz.sig CHANGED
Binary file