csvlint 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/features/cli.feature +6 -3
- data/features/step_definitions/cli_steps.rb +6 -2
- data/lib/csvlint/cli.rb +1 -1
- data/lib/csvlint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Zjg3NDc5YjI0ZGYwOGFkNzVkOWVlNWQ0NDgyNDhjMDRmN2Y2ZmY0OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjZhYWNlYWE5NDlkYWI4ZjZmMmFmYmNlN2Y1M2NhNDY5YTg1M2RiMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmM1OWFlODNiMzE5MWY4MmIxM2NjM2NjYzk4NThjNzQxM2EwNzRmODNlNWMy
|
10
|
+
ODA1YzJhZTEyNzc1ODA4ZjdjODk2ZWQwMTFjNWI5YWYzY2Y2ZjNjMjI3NGI2
|
11
|
+
YzhmMGY5MDViYzc1NTYwYzUxZGU2MDFhYWI4MjEyOGEyMTg4YzE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjYyNjgzNWY1YzJkMDZhZGM3NzQ4YzE4NjczZTU0NmNiZjgyOWYxM2M0MjAz
|
14
|
+
NjkyZDhmYjJlOGI2OWZhNzI4MmQ2N2IzMjY5ZTllYjg4N2RhN2E4ZGEyYjgz
|
15
|
+
MjdkMDMyOWU5OTg2OWViY2NmZmU5NTQyNzZmODY2OGIzMTQ0ZTU=
|
data/features/cli.feature
CHANGED
@@ -17,7 +17,7 @@ Feature: CSVlint CLI
|
|
17
17
|
|
18
18
|
# This is a hacky way of saying to run `cat features/fixtures/valid.csv | csvlint`
|
19
19
|
Scenario: Valid CSV from pipe
|
20
|
-
Given I have stubbed
|
20
|
+
Given I have stubbed stdin to contain "features/fixtures/valid.csv"
|
21
21
|
When I run `csvlint`
|
22
22
|
Then the output should contain "CSV is VALID"
|
23
23
|
|
@@ -35,11 +35,13 @@ Feature: CSVlint CLI
|
|
35
35
|
Then the output should contain "non-existent-file.csv not found"
|
36
36
|
|
37
37
|
Scenario: No file or URL specified
|
38
|
+
Given I have stubbed stdin to contain nothing
|
38
39
|
When I run `csvlint`
|
39
40
|
Then the output should contain "No CSV data to validate"
|
40
41
|
|
41
42
|
Scenario: No file or URL specified, but schema specified
|
42
|
-
Given I have
|
43
|
+
Given I have stubbed stdin to contain nothing
|
44
|
+
And I have a schema with the following content:
|
43
45
|
"""
|
44
46
|
{
|
45
47
|
"fields": [
|
@@ -198,7 +200,8 @@ NO JSON HERE SON
|
|
198
200
|
And the output should contain "1. min_length. Row: 2,2. 5"
|
199
201
|
|
200
202
|
Scenario: CSVw table Schema
|
201
|
-
Given I have
|
203
|
+
Given I have stubbed stdin to contain nothing
|
204
|
+
And I have a metadata file called "csvw/countries.json"
|
202
205
|
And the metadata is stored at the url "http://w3c.github.io/csvw/tests/countries.json"
|
203
206
|
And I have a file called "csvw/countries.csv" at the url "http://w3c.github.io/csvw/tests/countries.csv"
|
204
207
|
And I have a file called "csvw/country_slice.csv" at the url "http://w3c.github.io/csvw/tests/country_slice.csv"
|
@@ -1,5 +1,9 @@
|
|
1
|
-
Given(/^I have stubbed
|
2
|
-
expect(
|
1
|
+
Given(/^I have stubbed stdin to contain "(.*?)"$/) do |file|
|
2
|
+
expect(STDIN).to receive(:read).and_return(File.read(file))
|
3
|
+
end
|
4
|
+
|
5
|
+
Given(/^I have stubbed stdin to contain nothing$/) do
|
6
|
+
expect(STDIN).to receive(:read).and_return(nil)
|
3
7
|
end
|
4
8
|
|
5
9
|
Then(/^nothing should be outputted to STDERR$/) do
|
data/lib/csvlint/cli.rb
CHANGED
@@ -31,7 +31,7 @@ module Csvlint
|
|
31
31
|
if source.nil?
|
32
32
|
# If no source is present, try reading from stdin
|
33
33
|
if !$stdin.tty?
|
34
|
-
source = StringIO.new(
|
34
|
+
source = StringIO.new(STDIN.read) rescue nil
|
35
35
|
return_error "No CSV data to validate" if !options[:schema] && source.nil?
|
36
36
|
end
|
37
37
|
else
|
data/lib/csvlint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csvlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pezholio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|