tsv 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +2 -0
- data/lib/tsv/cyclist.rb +1 -1
- data/lib/tsv/row.rb +1 -1
- data/lib/tsv/version.rb +1 -1
- data/spec/fixtures/empty-trailing.tsv +3 -0
- data/spec/tsv_integration_spec.rb +15 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dccfc4465a2459edbb3847afe9a97085a30c246a
|
4
|
+
data.tar.gz: 8f6c86869945c3bae1a9653b91fc7c7b5fdfa0f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0151a2a89fc5141711095bdc0f2f0fcb03de963947802cee913eeca5a19acfa18574c38978fa68f3012603399074bf68b13d079ee78979609f0e26fa3033b5ab
|
7
|
+
data.tar.gz: f6f18e7654c47a5a16721c4885e363beb2de78709806211a87da9b7684f86ddeff014c16df0ec3df8025463bce25df5606cfc4a10426c2d1831963c1fee10a9c
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
## [Unreleased][unreleased]
|
5
|
+
|
6
|
+
## [0.0.3] - 2014-12-26
|
7
|
+
### Fixed
|
8
|
+
- Fixed case with empty column contents in TSV
|
9
|
+
|
10
|
+
### Added
|
11
|
+
- First version of CHANGELOG.md
|
12
|
+
|
13
|
+
## [0.0.2] - 2014-08-13
|
14
|
+
### Changed
|
15
|
+
- Internal refactorings
|
16
|
+
|
17
|
+
### Added
|
18
|
+
- Testing built gem integrity via CI
|
19
|
+
|
20
|
+
Changelog format taken from [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog)
|
21
|
+
|
22
|
+
[unreleased]: https://github.com/mimimi/ruby-tsv/compare/v0.0.3...master
|
23
|
+
[0.0.3]: https://github.com/mimimi/ruby-tsv/compare/v0.0.2...v0.0.3
|
24
|
+
[0.0.2]: https://github.com/mimimi/ruby-tsv/compare/v0.0.1...v0.0.2
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Tsv
|
2
2
|
[![Build Status](https://travis-ci.org/mimimi/ruby-tsv.svg?branch=master)](https://travis-ci.org/mimimi/ruby-tsv)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/mimimi/ruby-tsv/badges/gpa.svg)](https://codeclimate.com/github/mimimi/ruby-tsv)
|
4
|
+
[![Test Coverage](https://codeclimate.com/github/mimimi/ruby-tsv/badges/coverage.svg)](https://codeclimate.com/github/mimimi/ruby-tsv)
|
3
5
|
|
4
6
|
A simple TSV parser, developed with aim of parsing a ~200Gb TSV dump. As such, no mode of operation, but enumerable is considered sane. Feel free to use `#to_a` on your supercomputer :)
|
5
7
|
|
data/lib/tsv/cyclist.rb
CHANGED
data/lib/tsv/row.rb
CHANGED
@@ -28,7 +28,7 @@ module TSV
|
|
28
28
|
@data = data
|
29
29
|
@header = header
|
30
30
|
|
31
|
-
raise InputError if @data.length != @header.length
|
31
|
+
raise InputError.new("Row has #{@data.length} columns, but #{@header.length} columns expected") if @data.length != @header.length
|
32
32
|
end
|
33
33
|
|
34
34
|
def with_header
|
data/lib/tsv/version.rb
CHANGED
@@ -47,6 +47,20 @@ describe TSV do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
context "when file includes empty trailing fields" do
|
52
|
+
let(:filename) { 'empty-trailing.tsv' }
|
53
|
+
|
54
|
+
context "when no block is passed" do
|
55
|
+
let(:parameters) { Hash.new }
|
56
|
+
|
57
|
+
it "returns its content as array of hashes" do
|
58
|
+
headers = %w{first second third}
|
59
|
+
expect(subject).to eq [ TSV::Row.new( ['0', '1', '2'], headers ),
|
60
|
+
TSV::Row.new( ['one', '', ''], headers ) ]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
50
64
|
end
|
51
65
|
|
52
66
|
describe "reading from string" do
|
@@ -92,4 +106,4 @@ describe TSV do
|
|
92
106
|
end
|
93
107
|
end
|
94
108
|
end
|
95
|
-
end
|
109
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tsv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmytro Soltys
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Streamed TSV parser
|
15
15
|
email:
|
@@ -19,9 +19,10 @@ executables: []
|
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
|
-
- .gitignore
|
23
|
-
- .rspec
|
24
|
-
- .travis.yml
|
22
|
+
- ".gitignore"
|
23
|
+
- ".rspec"
|
24
|
+
- ".travis.yml"
|
25
|
+
- CHANGELOG.md
|
25
26
|
- Gemfile
|
26
27
|
- LICENSE.txt
|
27
28
|
- README.md
|
@@ -31,6 +32,7 @@ files:
|
|
31
32
|
- lib/tsv/row.rb
|
32
33
|
- lib/tsv/version.rb
|
33
34
|
- spec/fixtures/broken.tsv
|
35
|
+
- spec/fixtures/empty-trailing.tsv
|
34
36
|
- spec/fixtures/empty.tsv
|
35
37
|
- spec/fixtures/example.tsv
|
36
38
|
- spec/lib/tsv/file_cyclist_spec.rb
|
@@ -51,23 +53,24 @@ require_paths:
|
|
51
53
|
- lib
|
52
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
55
|
requirements:
|
54
|
-
- -
|
56
|
+
- - ">="
|
55
57
|
- !ruby/object:Gem::Version
|
56
58
|
version: '0'
|
57
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
60
|
requirements:
|
59
|
-
- -
|
61
|
+
- - ">="
|
60
62
|
- !ruby/object:Gem::Version
|
61
63
|
version: '0'
|
62
64
|
requirements: []
|
63
65
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.2.2
|
65
67
|
signing_key:
|
66
68
|
specification_version: 4
|
67
69
|
summary: Provides a simple parser for standard compliant and not so (missing header
|
68
70
|
line) TSV files
|
69
71
|
test_files:
|
70
72
|
- spec/fixtures/broken.tsv
|
73
|
+
- spec/fixtures/empty-trailing.tsv
|
71
74
|
- spec/fixtures/empty.tsv
|
72
75
|
- spec/fixtures/example.tsv
|
73
76
|
- spec/lib/tsv/file_cyclist_spec.rb
|