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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rxraw-lineparser.rb +20 -12
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 406590b7dbde2ddab15f9556ff5d73e0420caa62
|
4
|
+
data.tar.gz: 067dca78e362d3f104f0ed1ff1bd791f653125f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b55c5d12567c87bfa5594ee74359fc1df42fee74209f0a3febdd72c6063353f3a16c893194b0115f0e650b3f4687c82a785da6cf3259be13a6c37dc6a7b68a67
|
7
|
+
data.tar.gz: 7ed52a9e234e8663090c67bb3bfe9787a9f107d9a83cfaa7fa6afa83b8351a04b236cd18242f47e6b6a856ce088b94475e9b644a4aea5681f98aeaba7fe60a94
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rxraw-lineparser.rb
CHANGED
@@ -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
|
37
|
-
#
|
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
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
45
|
-
|
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
metadata.gz.sig
CHANGED
Binary file
|