data_janitor 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1e2175721dcb69d3e00654757c21e0b6ab436d3
4
- data.tar.gz: ea56a1fca5a426d3cc7a1dbec6617547c9a20b9c
3
+ metadata.gz: 28258e2ec98f8f7db00397740aca503713a4ffba
4
+ data.tar.gz: 58f562e76d73c73214d49c0c2616d33e80b9b975
5
5
  SHA512:
6
- metadata.gz: ebe78a665cec31decee279dbe78ba2a83c429537019f5e56411ebb652cbaf5a46b33f41292022cf7bb1387afdfa4b4d7d008f0713e313ad7205fcd2efc275fc2
7
- data.tar.gz: dde5d82e8ecd9aaddd34411fbac8dbcb5c650189afafa9dfda911a3164618bd8494919be5f1f08573d6471b92f7f28a7103f6b292991827de0e84184d5866cb9
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
- report_error.call "cannot have leading/trailing whitespaces" if field_val =~ /^\s/ || field_val =~ /\s$/
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
@@ -1,3 +1,3 @@
1
1
  module DataJanitor
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
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.6
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-29 00:00:00.000000000 Z
12
+ date: 2017-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails