bipbip 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe7f32a299c9d06b71d8599033430b810b91e365
4
- data.tar.gz: 65275e6d51c12f947433bffd47d8b0fa915f9b2a
3
+ metadata.gz: 767f7a2a56b1e00dc86b36f60d4599440ca5f226
4
+ data.tar.gz: 3619bb7f7c507ae3687df15d5e4231ac5a930070
5
5
  SHA512:
6
- metadata.gz: 81fcc4bbced95d1a6fa34739fec24e94a790937be7b3ac9c111dd82963003580e931d67b113dc757df9cbd6c54b9fafb9b89dbc00c6a9ce2c7ac739985660ee2
7
- data.tar.gz: 381a7c4e18a31068c755fd64f43430d34dd647fca4682f2fb29f088e5e533a981fcb9d0c1dc5541f065d6641143e5e43eb3f001444fa79ff212355520906fd3c
6
+ metadata.gz: 7700dd1f8f8de9a8e4e8a77b09f8e2e5281b745c22fcec18add44e12224acd9deec5c57b7272a0c50fa24dd17cf208a9f31f8f60170b8bc1c7683a0ee9166ec3
7
+ data.tar.gz: 5bec57fe7ba560975a231c647b50dfa15adc16c02b830dc127153d832300961d50060cc8aa8fb711b1e894db3b0af1e7d34b37ad394f0e45ca9dea14cdb5e4ac
@@ -3,6 +3,7 @@ require 'date'
3
3
  module Bipbip
4
4
 
5
5
  TIMESTAMP_REGEXP = '^\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}'
6
+ REGEXP_IGNORE_LINE = '^\s*$'
6
7
 
7
8
  class Plugin::LogParser < Plugin
8
9
 
@@ -16,11 +17,15 @@ module Bipbip
16
17
  time_first = nil
17
18
 
18
19
  lines = lines_backwards.take_while do |line|
19
- timestamp_match = line.match(regexp_timestamp)
20
- raise "Line doesn't match `#{regexp_timestamp}`: `#{line}`" if timestamp_match.nil?
21
- time = DateTime.parse(timestamp_match[0]).to_time
22
- time_first ||= time
23
- (time > log_time_min)
20
+ if line.match(REGEXP_IGNORE_LINE)
21
+ true
22
+ elsif timestamp_match = line.match(regexp_timestamp)
23
+ time = DateTime.parse(timestamp_match[0]).to_time
24
+ time_first ||= time
25
+ (time > log_time_min)
26
+ else
27
+ Bipbip::logger.warn("Log parser: Unparseable line `#{line.chomp}` in `#{config['path']}`")
28
+ end
24
29
  end
25
30
 
26
31
  self.log_time_min = time_first unless time_first.nil?
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bipbip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media