handleit 1.1.3 → 1.1.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/handle.rb +3 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc355df87f74ad63f9fffdcc5ffb9482fc5e3c7f5d5415cc0cd6dc58070f624e
4
- data.tar.gz: c54dc82c7299f76dfd278d686cfd38defa4074483c534dbc79989974d0138f1b
3
+ metadata.gz: 48abe8d4e518fe2fd5a145caddbaeb5c846bab5336b9664946860be23fffc3d0
4
+ data.tar.gz: fe9d07b6970a8cec47d9ede62d01940f8bf27b366293fe2d79a6a3c8a69bed6a
5
5
  SHA512:
6
- metadata.gz: 2033f523f28052c29b2dcbe014dc642cf2469163def8665d9ca311346139e146a1d4b83b5d2e2266aa0af1633fab325f1223d054a20927f2e6b3f1cf7595dbf9
7
- data.tar.gz: 6bbae8d1827bdf6e579b9b388f6ee03754c55b8454caacf8b8e67b17d6d620b71c647aaf7ac74399a893fc3b96d99e89a70809bed93a90526ddf148b5c923b09
6
+ metadata.gz: e8bde98288716def4af2cc092b38fbbe053fd0408e6e66e0922d266e8a7cfc463e29b3744c13f36c943fc66feb7144c5000e6deece828ab66a2039ac8a0b656b
7
+ data.tar.gz: 3fc08d3a9cb26f8cb89075513d8b3ee28380609a6114916d1c37cd7247cc0216b337f4efe87d0f1b3472d8c21932abb0cd6409006a780d211cfda42fe376cbb8
data/lib/handle.rb CHANGED
@@ -50,9 +50,9 @@ class Handle
50
50
  end
51
51
 
52
52
  def validate(options)
53
- condition = options[:when]
54
- condition_error = options[:error] || 'Not Valid!'
55
- good_to_go = condition&.respond_to?(:call) ? condition&.call : true
53
+ condition = options[:when] || true
54
+ condition_error = options[:error] || options[:not_valid_error] || 'Not Valid!'
55
+ good_to_go = condition&.respond_to?(:call) ? condition&.call : condition
56
56
  raise NotValidError, condition_error unless good_to_go
57
57
  end
58
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handleit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov