data_janitor 0.3.6 → 0.3.7
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.
- checksums.yaml +4 -4
- data/lib/data_janitor/universal_validator.rb +3 -1
- data/lib/data_janitor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28258e2ec98f8f7db00397740aca503713a4ffba
|
|
4
|
+
data.tar.gz: 58f562e76d73c73214d49c0c2616d33e80b9b975
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3be58cb1964db6279c0227cb8efc99c1dd0bcf008d860ea00bb7c71bbc8b18665a78dcb7a28cee88f3ec0507ed8bb0bde0c567015b1eb690694bdbc58e48057e
|
|
7
|
+
data.tar.gz: b04f75842fc3bde77e987d264b4ac3946caad5f28b33bf0c414bf774f5e7dbbc03171a7399cc59f7bd5b7b2e4759c24527eb9e0dda2066f927a0efd003b33616
|
|
@@ -38,9 +38,11 @@ module DataJanitor
|
|
|
38
38
|
# TODO: run numericality test
|
|
39
39
|
when :string, :text
|
|
40
40
|
if field_val.nil?
|
|
41
|
+
# Almost never does an app need to distinguish between nil and empty string, yet nil needs special handling in all cases
|
|
41
42
|
report_error.call "cannot be nil. Use an empty string instead if that's what you wanted."
|
|
42
43
|
else
|
|
43
|
-
|
|
44
|
+
# Our apps strings output text to the web where whitespace is meaningless
|
|
45
|
+
report_error.call "cannot have leading/trailing whitespaces" if field_val =~ /\A\s/ || field_val =~ /\s\z/
|
|
44
46
|
# TODO: Should we constrain to certain encoding types?
|
|
45
47
|
end
|
|
46
48
|
end
|
data/lib/data_janitor/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: data_janitor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Louis Tran
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-08-
|
|
12
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|