honey_format 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/honey_format/exceptions.rb +4 -2
- data/lib/honey_format/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 976b0f358d1577605a7cf6774c0bfa0d8cc417dc
|
4
|
+
data.tar.gz: 692ee6e558f64ff7cded7e1e3d2b0b3fe33e3d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7da999d1c8b1b938111752b87c6174bc8d5119c0d8acd46100fd6d6add24ef48a03153a4df8f6d5153ade514bc40dfbcd6e121b9a9fb4da102b60d6eef9eb81
|
7
|
+
data.tar.gz: cdf05e13e33c42d7942becd58f4db7a9ffac59e7b05a86a793ae97861f18a9f72064605fc2de331aa46384b80f1c28878534452ca6d6cc7e5e89456cd979de42
|
data/README.md
CHANGED
@@ -55,7 +55,7 @@ Validate CSV header
|
|
55
55
|
csv_string = "Id, Username\n 1, buren"
|
56
56
|
# Invalid
|
57
57
|
HoneyCSV.new(csv_string, valid_columns: [:something, :username])
|
58
|
-
# => #<HoneyFormat::
|
58
|
+
# => #<HoneyFormat::MissingCSVHeaderColumnError: key :id ("Id") not in [:something, :username]>
|
59
59
|
|
60
60
|
# Valid
|
61
61
|
csv = HoneyCSV.new(csv_string, valid_columns: [:id, :username])
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module HoneyFormat
|
2
2
|
# Raised when header is missing
|
3
3
|
class MissingCSVHeaderError < StandardError; end
|
4
|
+
# Raised when there is a CSV header column error
|
5
|
+
class CSVHeaderColumnError < StandardError; end
|
4
6
|
# Raised when header column is missing
|
5
|
-
class MissingCSVHeaderColumnError <
|
7
|
+
class MissingCSVHeaderColumnError < CSVHeaderColumnError; end
|
6
8
|
# Raised when a column is not in passed valid columns
|
7
|
-
class UnknownCSVHeaderColumnError <
|
9
|
+
class UnknownCSVHeaderColumnError < CSVHeaderColumnError; end
|
8
10
|
# Raised when columns are empty
|
9
11
|
class EmptyColumnsError < ArgumentError; end
|
10
12
|
# Raised when row has more columns than columns
|
data/lib/honey_format/version.rb
CHANGED