csv_schema 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/csv_schema.gemspec +2 -2
- data/lib/csv_schema.rb +1 -1
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.1
|
data/csv_schema.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{csv_schema}
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.1"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["jconley"]
|
|
12
|
-
s.date = %q{2010-12-
|
|
12
|
+
s.date = %q{2010-12-20}
|
|
13
13
|
s.description = %q{This validator is intended to be run on csv files that are updated and received on a regular basis. It allows you to specify required headers the following data restrictions: columns that must be unique, columns that must be restricted to certain values, or columns that can't allow nil values. This gem checks that the newly received file is consistent with the specified 'csv schema'. This frees you form having to manually check that the new file has not changed and reduces the possibility that an unnoticed change will cause any subsequent analyses to be incorrect. }
|
|
14
14
|
s.email = %q{}
|
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/csv_schema.rb
CHANGED
|
@@ -46,7 +46,7 @@ class CSVSchema
|
|
|
46
46
|
|
|
47
47
|
private
|
|
48
48
|
def index_field_requirements_by_column_number
|
|
49
|
-
headers_to_column_number = {}
|
|
49
|
+
headers_to_column_number = Hash.new { |hash, key| raise "The specified column '#{key}' does not exist" }
|
|
50
50
|
@headers.each_with_index do |header, column_number|
|
|
51
51
|
headers_to_column_number[header] = column_number
|
|
52
52
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: csv_schema
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 29
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.0.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- jconley
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-12-
|
|
18
|
+
date: 2010-12-20 00:00:00 -05:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|