csv-probe 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -2
- data/README.md +3 -0
- data/lib/csv/probe/checks.rb +7 -3
- data/lib/csv/probe/version.rb +1 -1
- data/lib/csv/probe.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ea99229e9677a6c02d4197055be87cf2d7f052d1290cffad61a0cfb93c40175
|
4
|
+
data.tar.gz: 4fbfbb4f010b5582a18671dd64a31bc8802fd831fb3dd3c4a5c447f9b2fd97d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b07ec40e594dfcf0e081ba5fbb8f625a993e7f7aadd48c4027346e1589ec5e61767ff14d8950c078d934ad1f3ecc8818d7a6be4721a73210cb41fdf63a15ba
|
7
|
+
data.tar.gz: 3bf6d4365cb06bde99db33d52dbfea06ea202344dcab334723a39d20ce27eba91a53d49464d0af3132b83302d2d9942bd09cdcd3943661b9c702788f7e04f523
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.3] - 2022-01-04
|
4
|
+
- Add better `nil` handling to list + set column checks. `nil` resp. `""` does no longer implicitly pass ColumnIsListWithDomain and ColumnIsSetWithDomain checks. `nil` or `""` has to be in the expected items in order to pass the check now.
|
5
|
+
|
3
6
|
## [0.1.2] - 2022-01-03
|
4
|
-
- Fix
|
7
|
+
- Fix README.md
|
5
8
|
|
6
9
|
## [0.1.1] - 2022-01-02
|
7
10
|
- Fix rubocop warnings
|
8
|
-
- Improve
|
11
|
+
- Improve README.md
|
9
12
|
|
10
13
|
## [0.1.0] - 2022-01-02
|
11
14
|
|
data/README.md
CHANGED
data/lib/csv/probe/checks.rb
CHANGED
@@ -191,7 +191,11 @@ module Probe
|
|
191
191
|
def initialize(varname, expected_items_arr, separator, _placeholder = nil) # rubocop:disable Metrics/MethodLength
|
192
192
|
super(varname, nil, nil)
|
193
193
|
@ok_condition_fn = lambda { |val, _cfg|
|
194
|
+
expected_items_arr.map!(&:to_s) # turn nil -> ""
|
195
|
+
|
194
196
|
items = val.split(separator)
|
197
|
+
return true if items.empty? && expected_items_arr.include?("") # empty str allowed
|
198
|
+
|
195
199
|
return items.all? { |e| expected_items_arr.include?(e) }
|
196
200
|
}
|
197
201
|
@fail_msg = lambda { |row, _opts|
|
@@ -208,8 +212,6 @@ module Probe
|
|
208
212
|
def initialize(varname, separator, _placeholder = nil) # rubocop:disable Metrics/MethodLength
|
209
213
|
super(varname, nil, nil)
|
210
214
|
@ok_condition_fn = lambda { |val, _cfg|
|
211
|
-
return true if val.to_s == ""
|
212
|
-
|
213
215
|
items = val.split(separator)
|
214
216
|
all_uniq = (items.size == items.uniq.size)
|
215
217
|
return all_uniq
|
@@ -228,9 +230,11 @@ module Probe
|
|
228
230
|
super(varname, nil, nil)
|
229
231
|
@pre_checks << ColumnIsSet.new(varname, separator)
|
230
232
|
@ok_condition_fn = lambda { |val, _cfg|
|
231
|
-
|
233
|
+
expected_items_arr.map!(&:to_s) # turn nil -> ""
|
232
234
|
|
233
235
|
items = val.split(separator)
|
236
|
+
return true if items.empty? && expected_items_arr.include?("") # empty str allowed
|
237
|
+
|
234
238
|
all_valid = items.all? { |i| expected_items_arr.include?(i) }
|
235
239
|
return all_valid
|
236
240
|
}
|
data/lib/csv/probe/version.rb
CHANGED
data/lib/csv/probe.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv-probe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- homebase.dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: csv
|