csvlint 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWY4NmZlNTBlYjBlZWU2MjY5NmEzNGUzNWI1ZTkzN2Y1MDcyZjQ0ZA==
5
- data.tar.gz: !binary |-
6
- YTI3ODc0NWFlMzAxMzJkZTJiZjZkNjBkNmI3YjkxMDFiMTlhM2JjMQ==
2
+ SHA1:
3
+ metadata.gz: 5fde1a99bd8ba107eb62c278f19693173a0aee36
4
+ data.tar.gz: 936f65fc500cb7f553869bcd3c3bffb013063e27
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NTQwOGE2ZjdhMzg0OGJjYzFjNGQ2ZjFkMDQ0YTU1YjEzYmEyNzA4MzgyMjEw
10
- ZmM4NGZjOWZkNWQ3YzVlNGI5ODlmMWY0Y2YwZWI4OTIwMDBiZWIxZDVlYzZh
11
- Y2JhN2Q4MzY2ODQyYTBiMjBlZTU3OTEzZDU4NTZmOGU2ZWM3OGI=
12
- data.tar.gz: !binary |-
13
- YzhiOGUzYjEwYTc1YWJhMDQ2MGY2MTk5Zjk2NjI0ZjQzNzEwYTE4ZTk1NTZh
14
- Mjc2MzcyZmJmZmNjN2ZmMDcwYWU1OTgzYTU0NDJiNGNjM2E3NDcwNWU1YTMy
15
- YjNiNzNjYzA0ZDgxODQ2ZjMyMDgyM2IzYmQxODY5ZGIzYjE2NDA=
6
+ metadata.gz: 039ae4035bf268a42f5edc8df7fc66dc77b68022c52d27ada0c041b1fac87a9f7fc3006aabfcabde3b51649262963f92b1978cd69834d16a1720aaa7efd2fffa
7
+ data.tar.gz: 1110e36fe0fedb1bff498fb9180b47272973063af200c3d388392e581ea2d1492c979e22da77f6de6381bba5d8c347381e737f1bb50349db00df7941a8dce9fe
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1.0
5
5
  - 2.2.0
6
+ - 2.3.1
6
7
  sudo: false
7
8
  cache: bundler
8
9
  notifications:
data/csvlint.gemspec CHANGED
@@ -21,12 +21,14 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "mime-types"
22
22
  spec.add_dependency "colorize"
23
23
  spec.add_dependency "open_uri_redirections"
24
- spec.add_dependency "activesupport"
24
+ spec.add_dependency "activesupport", "< 5.0"
25
25
  spec.add_dependency "addressable"
26
26
  spec.add_dependency "typhoeus"
27
27
  spec.add_dependency "escape_utils"
28
28
  spec.add_dependency "uri_template"
29
29
  spec.add_dependency "thor"
30
+ spec.add_dependency "rack", "< 2.0"
31
+ spec.add_dependency "net-http-persistent", "< 3.0"
30
32
 
31
33
  spec.add_development_dependency "bundler", "~> 1.3"
32
34
  spec.add_development_dependency "rake"
@@ -42,7 +44,7 @@ Gem::Specification.new do |spec|
42
44
  spec.add_development_dependency "pry"
43
45
  spec.add_development_dependency "github_changelog_generator"
44
46
  spec.add_development_dependency "aruba"
45
- spec.add_development_dependency "rdf"
47
+ spec.add_development_dependency "rdf", "< 2.0"
46
48
  spec.add_development_dependency "rdf-turtle"
47
49
  spec.add_development_dependency "henry"
48
50
 
@@ -11,7 +11,14 @@ module Csvlint
11
11
  value, warnings = check_common_property_value(value, base_url, lang)
12
12
  return value, warnings, :annotation
13
13
  else
14
- return value, :invalid_property, nil
14
+ # property name must be an absolute URI
15
+ begin
16
+ return value, :invalid_property, nil if URI(property).scheme.nil?
17
+ value, warnings = check_common_property_value(value, base_url, lang)
18
+ return value, warnings, :annotation
19
+ rescue
20
+ return value, :invalid_property, nil
21
+ end
15
22
  end
16
23
  end
17
24
 
@@ -62,7 +62,8 @@ module Csvlint
62
62
  if validate
63
63
  unless @primary_key.nil?
64
64
  key = @primary_key.map { |column| column.validate(values[column.number - 1], row) }
65
- build_errors(:duplicate_key, :schema, row, nil, key.join(","), @primary_key_values[key]) if @primary_key_values.include?(key)
65
+ colnum = if primary_key.length == 1 then primary_key[0].number else nil end
66
+ build_errors(:duplicate_key, :schema, row, colnum, key.join(","), @primary_key_values[key]) if @primary_key_values.include?(key)
66
67
  @primary_key_values[key] = row
67
68
  end
68
69
  # build a record of the unique values that are referenced by foreign keys from other tables
@@ -103,11 +104,12 @@ module Csvlint
103
104
  reset
104
105
  local = @foreign_key_reference_values[foreign_key]
105
106
  context = { "from" => { "url" => remote_url.to_s.split("/")[-1], "columns" => foreign_key["columnReference"] }, "to" => { "url" => @url.to_s.split("/")[-1], "columns" => foreign_key["reference"]["columnReference"] }}
106
- remote.each do |r|
107
+ colnum = if foreign_key["referencing_columns"].length == 1 then foreign_key["referencing_columns"][0].number else nil end
108
+ remote.each_with_index do |r,i|
107
109
  if local[r]
108
- build_errors(:multiple_matched_rows, :schema, nil, nil, r, context) if local[r].length > 1
110
+ build_errors(:multiple_matched_rows, :schema, i+1, colnum, r, context) if local[r].length > 1
109
111
  else
110
- build_errors(:unmatched_foreign_key_reference, :schema, nil, nil, r, context)
112
+ build_errors(:unmatched_foreign_key_reference, :schema, i+1, colnum, r, context)
111
113
  end
112
114
  end
113
115
  return valid?
@@ -38,6 +38,9 @@ module Csvlint
38
38
  else
39
39
  return Schema.from_json_table(uri,json)
40
40
  end
41
+ rescue TypeError => e
42
+ # NO IDEA what this was even trying to do - SP 20160526
43
+
41
44
  rescue Csvlint::Csvw::MetadataError => e
42
45
  raise e
43
46
  rescue OpenURI::HTTPError, Errno::ENOENT => e
@@ -123,6 +123,7 @@ module Csvlint
123
123
  validate_metadata
124
124
  end
125
125
  request.on_body do |chunk|
126
+ chunk.force_encoding(Encoding::UTF_8) if chunk.encoding == Encoding::ASCII_8BIT
126
127
  io = StringIO.new(chunk)
127
128
  io.each_line do |line|
128
129
  break if line_limit_reached?
@@ -1,3 +1,3 @@
1
1
  module Csvlint
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,377 +1,405 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pezholio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-24 00:00:00.000000000 Z
11
+ date: 2016-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colorize
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: open_uri_redirections
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - "<"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '5.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - "<"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '5.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: addressable
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: typhoeus
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: escape_utils
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: uri_template
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: thor
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rack
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "<"
144
+ - !ruby/object:Gem::Version
145
+ version: '2.0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "<"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: net-http-persistent
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "<"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "<"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.0'
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: bundler
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
- - - ~>
171
+ - - "~>"
144
172
  - !ruby/object:Gem::Version
145
173
  version: '1.3'
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
- - - ~>
178
+ - - "~>"
151
179
  - !ruby/object:Gem::Version
152
180
  version: '1.3'
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: rake
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
- - - ! '>='
185
+ - - ">="
158
186
  - !ruby/object:Gem::Version
159
187
  version: '0'
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
- - - ! '>='
192
+ - - ">="
165
193
  - !ruby/object:Gem::Version
166
194
  version: '0'
167
195
  - !ruby/object:Gem::Dependency
168
196
  name: cucumber
169
197
  requirement: !ruby/object:Gem::Requirement
170
198
  requirements:
171
- - - ! '>='
199
+ - - ">="
172
200
  - !ruby/object:Gem::Version
173
201
  version: '0'
174
202
  type: :development
175
203
  prerelease: false
176
204
  version_requirements: !ruby/object:Gem::Requirement
177
205
  requirements:
178
- - - ! '>='
206
+ - - ">="
179
207
  - !ruby/object:Gem::Version
180
208
  version: '0'
181
209
  - !ruby/object:Gem::Dependency
182
210
  name: simplecov
183
211
  requirement: !ruby/object:Gem::Requirement
184
212
  requirements:
185
- - - ! '>='
213
+ - - ">="
186
214
  - !ruby/object:Gem::Version
187
215
  version: '0'
188
216
  type: :development
189
217
  prerelease: false
190
218
  version_requirements: !ruby/object:Gem::Requirement
191
219
  requirements:
192
- - - ! '>='
220
+ - - ">="
193
221
  - !ruby/object:Gem::Version
194
222
  version: '0'
195
223
  - !ruby/object:Gem::Dependency
196
224
  name: simplecov-rcov
197
225
  requirement: !ruby/object:Gem::Requirement
198
226
  requirements:
199
- - - ! '>='
227
+ - - ">="
200
228
  - !ruby/object:Gem::Version
201
229
  version: '0'
202
230
  type: :development
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
205
233
  requirements:
206
- - - ! '>='
234
+ - - ">="
207
235
  - !ruby/object:Gem::Version
208
236
  version: '0'
209
237
  - !ruby/object:Gem::Dependency
210
238
  name: spork
211
239
  requirement: !ruby/object:Gem::Requirement
212
240
  requirements:
213
- - - ! '>='
241
+ - - ">="
214
242
  - !ruby/object:Gem::Version
215
243
  version: '0'
216
244
  type: :development
217
245
  prerelease: false
218
246
  version_requirements: !ruby/object:Gem::Requirement
219
247
  requirements:
220
- - - ! '>='
248
+ - - ">="
221
249
  - !ruby/object:Gem::Version
222
250
  version: '0'
223
251
  - !ruby/object:Gem::Dependency
224
252
  name: webmock
225
253
  requirement: !ruby/object:Gem::Requirement
226
254
  requirements:
227
- - - ! '>='
255
+ - - ">="
228
256
  - !ruby/object:Gem::Version
229
257
  version: '0'
230
258
  type: :development
231
259
  prerelease: false
232
260
  version_requirements: !ruby/object:Gem::Requirement
233
261
  requirements:
234
- - - ! '>='
262
+ - - ">="
235
263
  - !ruby/object:Gem::Version
236
264
  version: '0'
237
265
  - !ruby/object:Gem::Dependency
238
266
  name: rspec
239
267
  requirement: !ruby/object:Gem::Requirement
240
268
  requirements:
241
- - - ! '>='
269
+ - - ">="
242
270
  - !ruby/object:Gem::Version
243
271
  version: '0'
244
272
  type: :development
245
273
  prerelease: false
246
274
  version_requirements: !ruby/object:Gem::Requirement
247
275
  requirements:
248
- - - ! '>='
276
+ - - ">="
249
277
  - !ruby/object:Gem::Version
250
278
  version: '0'
251
279
  - !ruby/object:Gem::Dependency
252
280
  name: rspec-pride
253
281
  requirement: !ruby/object:Gem::Requirement
254
282
  requirements:
255
- - - ! '>='
283
+ - - ">="
256
284
  - !ruby/object:Gem::Version
257
285
  version: '0'
258
286
  type: :development
259
287
  prerelease: false
260
288
  version_requirements: !ruby/object:Gem::Requirement
261
289
  requirements:
262
- - - ! '>='
290
+ - - ">="
263
291
  - !ruby/object:Gem::Version
264
292
  version: '0'
265
293
  - !ruby/object:Gem::Dependency
266
294
  name: rspec-expectations
267
295
  requirement: !ruby/object:Gem::Requirement
268
296
  requirements:
269
- - - ! '>='
297
+ - - ">="
270
298
  - !ruby/object:Gem::Version
271
299
  version: '0'
272
300
  type: :development
273
301
  prerelease: false
274
302
  version_requirements: !ruby/object:Gem::Requirement
275
303
  requirements:
276
- - - ! '>='
304
+ - - ">="
277
305
  - !ruby/object:Gem::Version
278
306
  version: '0'
279
307
  - !ruby/object:Gem::Dependency
280
308
  name: coveralls
281
309
  requirement: !ruby/object:Gem::Requirement
282
310
  requirements:
283
- - - ! '>='
311
+ - - ">="
284
312
  - !ruby/object:Gem::Version
285
313
  version: '0'
286
314
  type: :development
287
315
  prerelease: false
288
316
  version_requirements: !ruby/object:Gem::Requirement
289
317
  requirements:
290
- - - ! '>='
318
+ - - ">="
291
319
  - !ruby/object:Gem::Version
292
320
  version: '0'
293
321
  - !ruby/object:Gem::Dependency
294
322
  name: pry
295
323
  requirement: !ruby/object:Gem::Requirement
296
324
  requirements:
297
- - - ! '>='
325
+ - - ">="
298
326
  - !ruby/object:Gem::Version
299
327
  version: '0'
300
328
  type: :development
301
329
  prerelease: false
302
330
  version_requirements: !ruby/object:Gem::Requirement
303
331
  requirements:
304
- - - ! '>='
332
+ - - ">="
305
333
  - !ruby/object:Gem::Version
306
334
  version: '0'
307
335
  - !ruby/object:Gem::Dependency
308
336
  name: github_changelog_generator
309
337
  requirement: !ruby/object:Gem::Requirement
310
338
  requirements:
311
- - - ! '>='
339
+ - - ">="
312
340
  - !ruby/object:Gem::Version
313
341
  version: '0'
314
342
  type: :development
315
343
  prerelease: false
316
344
  version_requirements: !ruby/object:Gem::Requirement
317
345
  requirements:
318
- - - ! '>='
346
+ - - ">="
319
347
  - !ruby/object:Gem::Version
320
348
  version: '0'
321
349
  - !ruby/object:Gem::Dependency
322
350
  name: aruba
323
351
  requirement: !ruby/object:Gem::Requirement
324
352
  requirements:
325
- - - ! '>='
353
+ - - ">="
326
354
  - !ruby/object:Gem::Version
327
355
  version: '0'
328
356
  type: :development
329
357
  prerelease: false
330
358
  version_requirements: !ruby/object:Gem::Requirement
331
359
  requirements:
332
- - - ! '>='
360
+ - - ">="
333
361
  - !ruby/object:Gem::Version
334
362
  version: '0'
335
363
  - !ruby/object:Gem::Dependency
336
364
  name: rdf
337
365
  requirement: !ruby/object:Gem::Requirement
338
366
  requirements:
339
- - - ! '>='
367
+ - - "<"
340
368
  - !ruby/object:Gem::Version
341
- version: '0'
369
+ version: '2.0'
342
370
  type: :development
343
371
  prerelease: false
344
372
  version_requirements: !ruby/object:Gem::Requirement
345
373
  requirements:
346
- - - ! '>='
374
+ - - "<"
347
375
  - !ruby/object:Gem::Version
348
- version: '0'
376
+ version: '2.0'
349
377
  - !ruby/object:Gem::Dependency
350
378
  name: rdf-turtle
351
379
  requirement: !ruby/object:Gem::Requirement
352
380
  requirements:
353
- - - ! '>='
381
+ - - ">="
354
382
  - !ruby/object:Gem::Version
355
383
  version: '0'
356
384
  type: :development
357
385
  prerelease: false
358
386
  version_requirements: !ruby/object:Gem::Requirement
359
387
  requirements:
360
- - - ! '>='
388
+ - - ">="
361
389
  - !ruby/object:Gem::Version
362
390
  version: '0'
363
391
  - !ruby/object:Gem::Dependency
364
392
  name: henry
365
393
  requirement: !ruby/object:Gem::Requirement
366
394
  requirements:
367
- - - ! '>='
395
+ - - ">="
368
396
  - !ruby/object:Gem::Version
369
397
  version: '0'
370
398
  type: :development
371
399
  prerelease: false
372
400
  version_requirements: !ruby/object:Gem::Requirement
373
401
  requirements:
374
- - - ! '>='
402
+ - - ">="
375
403
  - !ruby/object:Gem::Version
376
404
  version: '0'
377
405
  description: CSV Validator
@@ -383,11 +411,11 @@ executables:
383
411
  extensions: []
384
412
  extra_rdoc_files: []
385
413
  files:
386
- - .coveralls.yml
387
- - .gitattributes
388
- - .gitignore
389
- - .ruby-version
390
- - .travis.yml
414
+ - ".coveralls.yml"
415
+ - ".gitattributes"
416
+ - ".gitignore"
417
+ - ".ruby-version"
418
+ - ".travis.yml"
391
419
  - CHANGELOG.md
392
420
  - Gemfile
393
421
  - LICENSE.md
@@ -470,12 +498,12 @@ require_paths:
470
498
  - lib
471
499
  required_ruby_version: !ruby/object:Gem::Requirement
472
500
  requirements:
473
- - - ! '>='
501
+ - - ">="
474
502
  - !ruby/object:Gem::Version
475
503
  version: '0'
476
504
  required_rubygems_version: !ruby/object:Gem::Requirement
477
505
  requirements:
478
- - - ! '>='
506
+ - - ">="
479
507
  - !ruby/object:Gem::Version
480
508
  version: '0'
481
509
  requirements: []