rxraw-lineparser 0.1.15 → 0.1.16

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: a7651da97d2eff42a8be807e5c233591a5686abc
4
- data.tar.gz: 2e6632823c7ab686c99214dc341652d9fa0b018d
3
+ metadata.gz: 406590b7dbde2ddab15f9556ff5d73e0420caa62
4
+ data.tar.gz: 067dca78e362d3f104f0ed1ff1bd791f653125f1
5
5
  SHA512:
6
- metadata.gz: d6cdbec7e54864279d35be5ae9192c4efdd45343d036f54a6e2762813154087d362d9eace37360853acf42279876fda21bcef050b77b96271cf2824215652275
7
- data.tar.gz: 31a4151bd16fff0febccd1f57a24466df61ecbf3f086d27a3d4859bfdd419d79cf51f93aa99b0fe3ad3b1878f2e7fb0f1234a8eba206df9328e943a4993aa9ed
6
+ metadata.gz: b55c5d12567c87bfa5594ee74359fc1df42fee74209f0a3febdd72c6063353f3a16c893194b0115f0e650b3f4687c82a785da6cf3259be13a6c37dc6a7b68a67
7
+ data.tar.gz: 7ed52a9e234e8663090c67bb3bfe9787a9f107d9a83cfaa7fa6afa83b8351a04b236cd18242f47e6b6a856ce088b94475e9b644a4aea5681f98aeaba7fe60a94
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -33,20 +33,29 @@ class RXRawLineParser
33
33
 
34
34
  field_names = @format_mask.to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym)
35
35
 
36
- patterns = possible_patterns(@format_mask)
37
- #patterns.each{|x| puts x.inspect}
36
+ # only perform possible patterns to match when a custom
37
+ # format_mask is detected
38
+ pattern = if @format_mask[0] != '\\' then
38
39
 
39
- if field_names.map{|x| "[!%s]" % x}.join(' ') == @format_mask \
40
- and field_names.length > 1 then
41
- insert2space_patterns(field_names.length, patterns)
40
+ patterns = possible_patterns(@format_mask)
41
+
42
+ if field_names.map{|x| "[!%s]" % x}.join(' ') == @format_mask \
43
+ and field_names.length > 1 then
44
+ insert2space_patterns(field_names.length, patterns)
45
+ end
46
+
47
+ pattern = patterns.detect {|x| line.match(/#{x.join}/)}.join
48
+
49
+ end_part = @format_mask[/[^\]]+$/].to_s
50
+ pattern += end_part
51
+ else
52
+
53
+ @format_mask.gsub(/\[!\w+\]/,'(.*)')
42
54
  end
55
+
43
56
 
44
- #patterns.each{|x| puts x.inspect}
45
- pattern = patterns.detect {|x| line.match(/#{x.join}/)}.join
46
- end_part = @format_mask[/[^\]]+$/].to_s
47
- pattern += end_part
48
- #puts 'pattern detected : ' + pattern.inspect
49
- field_values = line.match(/#{pattern}/).captures.map(&:strip)
57
+ field_values = line.match(/#{pattern}/).captures.map(&:strip)
58
+ #field_values = line.match(/#{@format_mask}/).captures.map(&:strip)
50
59
 
51
60
  found_quotes = find_qpattern(pattern)
52
61
 
@@ -129,7 +138,6 @@ class RXRawLineParser
129
138
 
130
139
  end
131
140
 
132
- #rr.each{|x| puts x.inspect}
133
141
 
134
142
  count = 2**main_fields
135
143
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxraw-lineparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file