jeti-log 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jeti/log/file.rb +1 -1
- data/lib/jeti/log/version.rb +1 -1
- data/spec/file_spec.rb +20 -0
- data/spec/sample-data/no-comments.log +16 -0
- data/spec/sample-data/sharp-in-comments.log +17 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec0e730ba22eea346a84d593d4d4a4b60458904b
|
4
|
+
data.tar.gz: 065ed6481f36ecd1d0b3ef83f0e53d0b1c31deaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81b05e15fc3d6d12b4dde25462753666f56a1ff6a39ef84f094193379ce40c875e3d0bce128a14c22f0aa7b86a325874734efde834c993f88cff722286130dcf
|
7
|
+
data.tar.gz: cf386bca21cb0b9b92757ae8664fda3545b7338b4c48734be0501ab5d8839632827c0247cd47818e65b9a64068b2243d23092db1bb1d047fa0a28db7a132fece
|
data/lib/jeti/log/file.rb
CHANGED
@@ -21,7 +21,7 @@ module Jeti; module Log;
|
|
21
21
|
lines = file.readlines.map(&:strip).group_by do |line|
|
22
22
|
line.start_with?('#') ? :comments : :rows
|
23
23
|
end
|
24
|
-
@name = lines.fetch(:comments, ['Unknown']).first
|
24
|
+
@name = /^#(.*)/.match(lines.fetch(:comments, ['# Unknown']).first)[1].strip
|
25
25
|
|
26
26
|
@headers = []
|
27
27
|
@entries = []
|
data/lib/jeti/log/version.rb
CHANGED
data/spec/file_spec.rb
CHANGED
@@ -359,6 +359,26 @@ describe Jeti::Log::File do
|
|
359
359
|
|
360
360
|
end
|
361
361
|
|
362
|
+
context 'with data file no-comments.log' do
|
363
|
+
|
364
|
+
before(:all) { @file = Jeti::Log::File.new(data_file('no-comments.log')) }
|
365
|
+
|
366
|
+
subject { @file }
|
367
|
+
|
368
|
+
its(:name) { should eql('Unknown') }
|
369
|
+
|
370
|
+
end
|
371
|
+
|
372
|
+
context 'with data file sharp-in-comments.log' do
|
373
|
+
|
374
|
+
before(:all) { @file = Jeti::Log::File.new(data_file('sharp-in-comments.log')) }
|
375
|
+
|
376
|
+
subject { @file }
|
377
|
+
|
378
|
+
its(:name) { should eql('Quad #4') }
|
379
|
+
|
380
|
+
end
|
381
|
+
|
362
382
|
it 'should raise for invalid or missing files' do
|
363
383
|
files = invalid_data_files
|
364
384
|
files.should have(9).files
|
@@ -0,0 +1,16 @@
|
|
1
|
+
000000000;4291420554;0;Tx;
|
2
|
+
000000000;4272321920;0;Rx;
|
3
|
+
000000000;4272321920;1;U Rx;V
|
4
|
+
000000000;4272321920;2;A1;
|
5
|
+
000000000;4272321920;3;A2;
|
6
|
+
000000000;4272321920;4;Q;%
|
7
|
+
001073617;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;98
|
8
|
+
001074119;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
9
|
+
001074639;4272321920;1;1;2;470;2;1;0;9;3;1;0;9;4;1;0;100
|
10
|
+
001075177;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
11
|
+
001075680;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
12
|
+
001076199;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
13
|
+
001076748;4272321920;1;1;2;469;2;1;0;9;3;1;0;9;4;1;0;100
|
14
|
+
001077239;4272321920;1;1;2;470;2;1;0;9;3;1;0;9;4;1;0;100
|
15
|
+
001077759;4272321920;1;1;2;469;2;1;0;9;3;1;0;9;4;1;0;100
|
16
|
+
001078315;4272321920;1;1;2;470;2;1;0;9;3;1;0;9;4;1;0;100
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Quad #4
|
2
|
+
000000000;4291420554;0;Tx;
|
3
|
+
000000000;4272321920;0;Rx;
|
4
|
+
000000000;4272321920;1;U Rx;V
|
5
|
+
000000000;4272321920;2;A1;
|
6
|
+
000000000;4272321920;3;A2;
|
7
|
+
000000000;4272321920;4;Q;%
|
8
|
+
001073617;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;98
|
9
|
+
001074119;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
10
|
+
001074639;4272321920;1;1;2;470;2;1;0;9;3;1;0;9;4;1;0;100
|
11
|
+
001075177;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
12
|
+
001075680;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
13
|
+
001076199;4272321920;1;1;2;471;2;1;0;9;3;1;0;9;4;1;0;100
|
14
|
+
001076748;4272321920;1;1;2;469;2;1;0;9;3;1;0;9;4;1;0;100
|
15
|
+
001077239;4272321920;1;1;2;470;2;1;0;9;3;1;0;9;4;1;0;100
|
16
|
+
001077759;4272321920;1;1;2;469;2;1;0;9;3;1;0;9;4;1;0;100
|
17
|
+
001078315;4272321920;1;1;2;470;2;1;0;9;3;1;0;9;4;1;0;100
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeti-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Veys
|
@@ -180,6 +180,8 @@ files:
|
|
180
180
|
- spec/sample-data/mezon-2.log
|
181
181
|
- spec/sample-data/mezon-3.log
|
182
182
|
- spec/sample-data/mui-50.log
|
183
|
+
- spec/sample-data/no-comments.log
|
184
|
+
- spec/sample-data/sharp-in-comments.log
|
183
185
|
- spec/sample-data/tx-controls.log
|
184
186
|
- spec/spec_helper.rb
|
185
187
|
homepage: ''
|
@@ -225,5 +227,7 @@ test_files:
|
|
225
227
|
- spec/sample-data/mezon-2.log
|
226
228
|
- spec/sample-data/mezon-3.log
|
227
229
|
- spec/sample-data/mui-50.log
|
230
|
+
- spec/sample-data/no-comments.log
|
231
|
+
- spec/sample-data/sharp-in-comments.log
|
228
232
|
- spec/sample-data/tx-controls.log
|
229
233
|
- spec/spec_helper.rb
|