jeti-log 0.5.2 → 0.5.3

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: 4bb528b7684e84f5cde665f4c911085b252ac0f2
4
- data.tar.gz: 8b3d8f19be622ef6de85a6766fa7b6b0a937b6f5
3
+ metadata.gz: ec0e730ba22eea346a84d593d4d4a4b60458904b
4
+ data.tar.gz: 065ed6481f36ecd1d0b3ef83f0e53d0b1c31deaf
5
5
  SHA512:
6
- metadata.gz: b99595ba99c6a0ef0cc94b6f009e01bcf1254840fe194490c2e50c052ea548a1560bcd8f2f6d173046a8fbcd6e4ba833b3e62aa10d514467892b0ffce02ffbd6
7
- data.tar.gz: 132e3d5b826a36b30c9aed2bb1d25e04e160a3c519b3198552cbb75896b80a466119c68b7d80c6f990d662ca903a12cd4d9d7e0a39a43e898855770502c6e568
6
+ metadata.gz: 81b05e15fc3d6d12b4dde25462753666f56a1ff6a39ef84f094193379ce40c875e3d0bce128a14c22f0aa7b86a325874734efde834c993f88cff722286130dcf
7
+ data.tar.gz: cf386bca21cb0b9b92757ae8664fda3545b7338b4c48734be0501ab5d8839632827c0247cd47818e65b9a64068b2243d23092db1bb1d047fa0a28db7a132fece
@@ -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.gsub(/#/, '').strip
24
+ @name = /^#(.*)/.match(lines.fetch(:comments, ['# Unknown']).first)[1].strip
25
25
 
26
26
  @headers = []
27
27
  @entries = []
@@ -1,5 +1,5 @@
1
1
  module Jeti
2
2
  module Log
3
- VERSION = '0.5.2'
3
+ VERSION = '0.5.3'
4
4
  end
5
5
  end
@@ -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.2
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