rxraw-lineparser 0.1.16 → 0.1.17

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: 406590b7dbde2ddab15f9556ff5d73e0420caa62
4
- data.tar.gz: 067dca78e362d3f104f0ed1ff1bd791f653125f1
3
+ metadata.gz: f8ad1231ba9340b8a58766193e468e162dbe7ad4
4
+ data.tar.gz: 7aff2188e2f7c190c84842ae2de40fc16dcb0d6e
5
5
  SHA512:
6
- metadata.gz: b55c5d12567c87bfa5594ee74359fc1df42fee74209f0a3febdd72c6063353f3a16c893194b0115f0e650b3f4687c82a785da6cf3259be13a6c37dc6a7b68a67
7
- data.tar.gz: 7ed52a9e234e8663090c67bb3bfe9787a9f107d9a83cfaa7fa6afa83b8351a04b236cd18242f47e6b6a856ce088b94475e9b644a4aea5681f98aeaba7fe60a94
6
+ metadata.gz: 8e8775be83defa653e19521ecde88621aca99bb0216d961911e16b8a345072486135b95a1154032dc410696dd29243b6dcfaf78ec511120e7d773ea59a130734
7
+ data.tar.gz: dcc819807480b5dca5e2396157fe035fa6b1d194143bceeeebc8fd310ade7d1099e50565804bde6eb17a99ae7d40fe9d8c17ebe43bff990ae35c8ef0407a7e45
checksums.yaml.gz.sig CHANGED
Binary file
@@ -23,7 +23,6 @@ module Enumerable
23
23
  end
24
24
 
25
25
  class RXRawLineParser
26
-
27
26
 
28
27
  def initialize(format_mask)
29
28
  @format_mask = format_mask
@@ -43,17 +42,22 @@ class RXRawLineParser
43
42
  and field_names.length > 1 then
44
43
  insert2space_patterns(field_names.length, patterns)
45
44
  end
46
-
47
- pattern = patterns.detect {|x| line.match(/#{x.join}/)}.join
48
45
 
49
- end_part = @format_mask[/[^\]]+$/].to_s
50
- pattern += end_part
46
+ pattern = patterns.detect do |x|
47
+ line.match(/#{x.join}/)
48
+ end.join
49
+
50
+ if patterns.length > 1 then
51
+ end_part = @format_mask[/[^\]]+$/].to_s
52
+ pattern += end_part
53
+ else
54
+ pattern
55
+ end
51
56
  else
52
57
 
53
58
  @format_mask.gsub(/\[!\w+\]/,'(.*)')
54
59
  end
55
-
56
-
60
+
57
61
  field_values = line.match(/#{pattern}/).captures.map(&:strip)
58
62
  #field_values = line.match(/#{@format_mask}/).captures.map(&:strip)
59
63
 
@@ -96,7 +100,7 @@ class RXRawLineParser
96
100
  pure_regex = format_mask.gsub(/\[!(\w+)\]/,'(?<\1>.*)')
97
101
  tot_fields = format_mask.scan(/\[!\w+\]/).length
98
102
 
99
- return [[pure_regex]] if tot_fields <= 1
103
+ return [[pure_regex]] if tot_fields <= 1 or @format_mask[0] != '['
100
104
 
101
105
  main_fields = tot_fields - 1
102
106
  qpattern = %q{(["'][^"']+["'])}
data.tar.gz.sig CHANGED
Binary file
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.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  y45JMqhHAfolGfPEOTYT4AtwQxTDUs67uvebNBxsU8sh31pL8L0zX3jIz1bVhNHQ
32
32
  4p4pAlul6ELCYA==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-07-10 00:00:00.000000000 Z
34
+ date: 2014-09-27 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
@@ -65,4 +65,3 @@ signing_key:
65
65
  specification_version: 4
66
66
  summary: rxraw-lineparser
67
67
  test_files: []
68
- has_rdoc:
metadata.gz.sig CHANGED
Binary file