cid 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/cid.rb +0 -1
- data/lib/cid/datapackage.rb +1 -4
- data/lib/cid/validation.rb +3 -2
- data/lib/cid/version.rb +1 -1
- metadata +1 -2
- data/lib/cid/helpers/file.rb +0 -8
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWM0ZjJlZDdjNWE5ZTAwOWRmYzg2MDYzODcyN2JlMWU3ODFiNGY3Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTFhMDE5N2RjMWI5YThkMjBiOGQ2NzM5OGNlMDU3N2M0ZWUwNTlkYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjZmZmVhMGY1ZDZhZDA5NDdhNWNiMjkxNDk1ZTM2YjBkYzc5MzJiMzBlNzQ0
|
10
|
+
OWMzYmVhODFjZDI2ZmU4MmUxZmYzYTRjMmFkZGU1MjIzYThiYjkxYTI1ODMy
|
11
|
+
YjQyNzhlNjFlMjM5ZGM4ODlmMjhjOGViM2E3NmFkODkyZTMyZDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODk4NmVhYzMxZjI1NGVjNjhlODI3ODg4YzJkOTE4ZTEzMTYzOWUzMWUwNTdm
|
14
|
+
ZjRkMWMxMWFlNmMwMDRhZWMyOWY3NTZjMGY0OGIzZTE0N2U2ZThmODk3ZDEy
|
15
|
+
YmNkZWFiNTNiZjA2MmYwMGVjYjA5MmRkYTYyODkzMzVkMDE0MGE=
|
data/lib/cid.rb
CHANGED
data/lib/cid/datapackage.rb
CHANGED
@@ -5,8 +5,6 @@ module Cid
|
|
5
5
|
|
6
6
|
class Datapackage
|
7
7
|
|
8
|
-
include Cid::Helpers::File
|
9
|
-
|
10
8
|
attr_accessor :json
|
11
9
|
|
12
10
|
def initialize(path)
|
@@ -54,8 +52,7 @@ module Cid
|
|
54
52
|
git.publish
|
55
53
|
end
|
56
54
|
|
57
|
-
def schema_for_file(
|
58
|
-
path = clean_file(file)
|
55
|
+
def schema_for_file(path)
|
59
56
|
begin
|
60
57
|
schema = @datapackage["resources"].select { |r| r["path"] == path }.first["schema"]
|
61
58
|
Csvlint::Schema.from_json_table(nil, schema)
|
data/lib/cid/validation.rb
CHANGED
@@ -19,11 +19,12 @@ module Cid
|
|
19
19
|
end
|
20
20
|
|
21
21
|
Dir["#{path}*.csv"].each do |csv|
|
22
|
-
|
22
|
+
ref = csv.split("/").last(2).join("/")
|
23
|
+
|
24
|
+
schema = Cid::Datapackage.new(root_path).schema_for_file(ref) if schema.nil?
|
23
25
|
|
24
26
|
validator = Csvlint::Validator.new(File.new(csv), nil, schema)
|
25
27
|
|
26
|
-
ref = csv.split("/").last(2).join("/")
|
27
28
|
result[ref] = {}
|
28
29
|
|
29
30
|
result[ref][:errors] = validator.errors
|
data/lib/cid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pezholio
|
@@ -328,7 +328,6 @@ files:
|
|
328
328
|
- lib/cid.rb
|
329
329
|
- lib/cid/bootstrap.rb
|
330
330
|
- lib/cid/datapackage.rb
|
331
|
-
- lib/cid/helpers/file.rb
|
332
331
|
- lib/cid/helpers/github.rb
|
333
332
|
- lib/cid/publish.rb
|
334
333
|
- lib/cid/validation.rb
|