validator_fn 0.2.8 → 0.3.8

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
  SHA256:
3
- metadata.gz: cecd9880750c518fcd26fd705b76ffeaf4604fb90af4bd60719ecf37a387d8ee
4
- data.tar.gz: d04d0ef810ab4ac5ea7b8914690c1995ffdf913c8ad4a40c5bfa85ce5ce8a817
3
+ metadata.gz: 6ea7512cdc3b010b687c5cf9d2fec7d79f6724c56547e31ced2903762e81e9b3
4
+ data.tar.gz: 5e45c2d9df2ff27104da89d0a97f19788a3de304b4575a3a317fa567620a6692
5
5
  SHA512:
6
- metadata.gz: 52647b99fdac1ff9dcf399b96d4b5a5becac6748270795cb47f0caa11e1735217239108450418781bf933dabdc0accf3ef3eaf7c9b8feb9fc1bd5f3deabe34d9
7
- data.tar.gz: 5c16a63c7a8f261cf8cf76af633dbc448975dd77cbe08074abf2dd8f77cca95b42baa3ce876c08d2f3186d52eee68edd1a94abea6b33440263e617364732d6a3
6
+ metadata.gz: e683c7186d468ac169210bab0a8033601b7873051381ee14f24dc1760d30f9dd8731723b303b8090464081afea842f8db309c8f5fc2d0666a54500efb31fd22d
7
+ data.tar.gz: f172ff2aa6e4b1f243ae50000da20f8a6cd86c385f872cbe0c2cea6f222e2c1b025ead98c1af6191637467646e1c11c42628bb9205546dc5a5ac8042b3f3b6ee
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- validator_fn (0.1.8)
4
+ validator_fn (0.2.8)
5
5
  fn_reader
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module ValidatorFn
2
- VERSION = "0.2.8"
2
+ VERSION = "0.3.8"
3
3
  end
data/lib/validator_fn.rb CHANGED
@@ -40,17 +40,10 @@ module ValidatorFn
40
40
  @@hash_of = ->fields, hash {
41
41
  hash ||= {}
42
42
  fields.reduce({}) do |memo, (key, fn)|
43
- value = hash.fetch(key, :missing_field)
44
- if value == :missing_field
45
- raise MissingKey.new(key)
46
- else
47
- memo[key] = fn.(hash[key]) if hash[key]
48
- end
43
+ memo[key] = fn.(hash[key])
49
44
  memo
50
- rescue MissingKey => e
51
- raise
52
45
  rescue Error => e
53
- invalid.("Invalid value for #{key.inspect} key.")
46
+ invalid.("Invalid value for #{key.inspect} key:")
54
47
  end
55
48
  }.curry
56
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validator_fn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Chabot