tabreader 1.0.0 → 1.0.1

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: 67dbbade5c8b10576053c868e1514c1f87ebb6c7
4
- data.tar.gz: 2a65adb418fbb89876c47f0427473c0ec7cc3448
3
+ metadata.gz: cbeb7c1c562cd485a9d3e0f6c13830030c6392ea
4
+ data.tar.gz: ffae690f9fc3386f5a85ba898456393a7660909b
5
5
  SHA512:
6
- metadata.gz: e15ec15bf2e2ee097ef9e58aafca69a68c0796e3ccea125367b47a0ca81497373d7058e4e66c9328e463bc915cc7e6c6c7eb6e105612d6a558e2baecdc4c70ca
7
- data.tar.gz: a900e51d7b15a509b8457b848c46ffc73fc3c26e41850671d5bc46416a99f45b5b006d6af38f3d23f2c0ee2ff5062ca4f515450d460742dd0551f5183d8f1db4
6
+ metadata.gz: 673e7a4ec3947d34db19848e14130db77c1638ff7101d5372b8d59b836c44149b20c52a09455925959ab4133bf9e52c25d7a4242e5f028785cd2fb2ff35483db
7
+ data.tar.gz: 2c52cea47febd5f42b49d8cb52f4ac192ad77cf516bddca7c92975d3aa05068b5940d2a36ca564aedc32400cc0aa5184ebe84c8c381cc8433a246e6112a735a4
@@ -3,12 +3,12 @@ LICENSE.md
3
3
  Manifest.txt
4
4
  README.md
5
5
  Rakefile
6
+ datasets/empty.tab
7
+ datasets/test.tab
6
8
  lib/tabreader.rb
7
9
  lib/tabreader/reader.rb
8
10
  lib/tabreader/reader_hash.rb
9
11
  lib/tabreader/version.rb
10
- test/data/empty.tab
11
- test/data/test.tab
12
12
  test/helper.rb
13
13
  test/test_reader.rb
14
14
  test/test_reader_hash.rb
File without changes
File without changes
@@ -20,5 +20,5 @@ Tab = TabReader
20
20
  TabHash = TabHashReader
21
21
 
22
22
 
23
-
24
- puts TabReader.banner # say hello
23
+ # say hello
24
+ puts TabReader.banner if $DEBUG || (defined?($RUBYCOCO_DEBUG) && $RUBYCOCO_DEBUG)
@@ -33,7 +33,7 @@ def logger() self.class.logger; end
33
33
 
34
34
 
35
35
 
36
- def self.parse_line( line )
36
+ def self.parse_line( line, sep: "\t" )
37
37
  ## check - can handle comments and blank lines too - why? why not?
38
38
  ## remove trailing newlines
39
39
 
@@ -60,7 +60,14 @@ def self.parse_line( line )
60
60
  # next
61
61
  # end
62
62
 
63
- values = line.split( "\t" )
63
+
64
+ # note: trailing empty fields get (auto-)trimmed by split !!!!!!!
65
+ # Solution!! change split( "\t" ) to split( "\t", -1 )
66
+ # If the limit parameter is omitted, trailing null fields are suppressed.
67
+ # If limit is a positive number, at most that number of fields will be returned
68
+ # (if limit is 1, the entire string is returned as the only entry in an array).
69
+ # If negative, there is no limit to the number of fields returned, and trailing null fields are not suppressed.
70
+ values = line.split( sep, -1 )
64
71
  logger.debug values.pretty_inspect if logger.debug?
65
72
 
66
73
  values
@@ -6,7 +6,7 @@ class TabReader
6
6
 
7
7
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
8
8
  MINOR = 0
9
- PATCH = 0
9
+ PATCH = 1
10
10
  VERSION = [MAJOR,MINOR,PATCH].join('.')
11
11
 
12
12
  def self.version
@@ -11,7 +11,7 @@ require 'tabreader'
11
11
  ## add test_data_dir helper
12
12
  class TabReader
13
13
  def self.test_data_dir
14
- "#{root}/test/data"
14
+ "#{root}/datasets"
15
15
  end
16
16
  end
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabreader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-16 00:00:00.000000000 Z
11
+ date: 2018-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -53,12 +53,12 @@ files:
53
53
  - Manifest.txt
54
54
  - README.md
55
55
  - Rakefile
56
+ - datasets/empty.tab
57
+ - datasets/test.tab
56
58
  - lib/tabreader.rb
57
59
  - lib/tabreader/reader.rb
58
60
  - lib/tabreader/reader_hash.rb
59
61
  - lib/tabreader/version.rb
60
- - test/data/empty.tab
61
- - test/data/test.tab
62
62
  - test/helper.rb
63
63
  - test/test_reader.rb
64
64
  - test/test_reader_hash.rb