csv-probe 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +8 -4
- data/lib/csv/probe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 441ebf45d96b8a4dd857fb07accc96117d38557e89697bfb7bda9f3552dfab0b
|
4
|
+
data.tar.gz: 629343b0c775afa3777c1087862b1ed1116a6c7a71c074fae386a4091d4fa0fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d38d085bb5cdf931e0b28bb392e74fda65cdd0fb5e6a48237fce7416b5c5defc67e1aa311dc3c301fff9a2c86f75fc6ce2be42c5a1ee971c1684086565175f2d
|
7
|
+
data.tar.gz: d50453598bbbd185db46d2d01ab62d72487540d30b24d60cdbcd99bf29a2ba7a44f13e36661837c6cc12dd12d1d1576f88dfe9f65561733b05adf016b233078d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -31,13 +31,17 @@ Example how to use Probe
|
|
31
31
|
0,PA,customer,2,03-12-2021,SHA;AN;RU,badger|ant
|
32
32
|
0,TE,guest,1000,06-11-2021,RU,spider|racoon|ant
|
33
33
|
ROWS
|
34
|
+
|
35
|
+
# define linting rules
|
34
36
|
checks = [Probe::ColumnIsEqualTo.new("col1", "0"),
|
35
37
|
Probe::ColumnMatchesRegEx.new("col2", /^(NU|PA|TE)$/),
|
36
|
-
Probe::ColumnIsOneOf.new("col3", [
|
37
|
-
Probe::ColumnMeetsCondition.new("col4",
|
38
|
+
Probe::ColumnIsOneOf.new("col3", %w[customer guest]),
|
39
|
+
Probe::ColumnMeetsCondition.new("col4", lambda { |val, _opts|
|
40
|
+
!Integer(val, exception: false).nil?
|
41
|
+
}, "Not an Integer"),
|
38
42
|
Probe::ColumnIsDate.new("col5", "%d-%m-%Y"),
|
39
|
-
Probe::ColumnIsListWithDomain.new("col6", [
|
40
|
-
Probe::ColumnIsSetWithDomain.new("col7", [
|
43
|
+
Probe::ColumnIsListWithDomain.new("col6", %w[FO RU SHA AN], ";"),
|
44
|
+
Probe::ColumnIsSetWithDomain.new("col7", %w[eagle hawk badger spider racoon ant], "|")]
|
41
45
|
|
42
46
|
# lint table
|
43
47
|
csv_table.lint(checks)
|
data/lib/csv/probe/version.rb
CHANGED