rxraw-lineparser 0.1.7 → 0.1.8

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/rxraw-lineparser.rb +6 -3
  2. metadata +1 -1
@@ -37,6 +37,9 @@ class RXRawLineParser
37
37
  #patterns.each{|x| puts x.inspect}
38
38
 
39
39
  pattern = patterns.detect {|x| line.match(/#{x.join}/)}.join
40
+ end_part = @format_mask[/[^\]]+$/].to_s
41
+ pattern += end_part
42
+ #puts 'pattern detected : ' + pattern.inspect
40
43
  field_values = line.match(/#{pattern}/).captures.map(&:strip)
41
44
 
42
45
  found_quotes = find_qpattern(pattern)
@@ -84,7 +87,7 @@ class RXRawLineParser
84
87
  if i < x.length - 1 then
85
88
  s = "([^%s]+)%s" % ([d]*2)
86
89
  else
87
- s = "([^%s]+)" % d
90
+ s = "([^%s]+)" % d
88
91
  end
89
92
  else
90
93
  s = i < x.length - 1 ? "(.*)(?=#{d})#{d}" : "(.*)"
@@ -94,7 +97,7 @@ class RXRawLineParser
94
97
 
95
98
  end
96
99
 
97
- r = x2.unshift '^' + part1 + x2.shift
100
+ r = x2.unshift '^' + part1 + x2.shift #+ end_part
98
101
 
99
102
  end
100
103
 
@@ -102,7 +105,7 @@ class RXRawLineParser
102
105
 
103
106
  count = 2**main_fields
104
107
 
105
- rr2 = rr.take(count+1).map {|x| x + ['(.*)']}
108
+ rr2 = rr.take(count+1).map {|x| x + [a[-1] +'(.*)']}
106
109
 
107
110
  if rr.length > 2 then
108
111
  wild_r = rr2.slice!(-1)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rxraw-lineparser
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.7
5
+ version: 0.1.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson