handleit 1.2.5 → 1.2.6

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 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c980fa58183dc34defe868759209c22ffc643e34b817d172b9a85cc103e93710
4
- data.tar.gz: 560d86343cf2073f1c7cb05d3a1377bcd240f93fb2ac9d5492cf3a0b644b2edc
3
+ metadata.gz: 2d1d9aa67b2978e194925dcbd564104257df6128cd764cf8b9cfc1fd79640584
4
+ data.tar.gz: 5ba49368ecba15844c3b749b9ce8a86c1cff4cbc9cb3adf6cd1d12dff4e4fd77
5
5
  SHA512:
6
- metadata.gz: 419127c3a8fbc102f2418604919982d7583272ae07b7e01475c782a0819d23aa92d2d71e2f309a1de5f10d541210b2807b2a1ecb74788031dc96b4491c0ff9b1
7
- data.tar.gz: 255a3dd89c13bf316cdf1f3bddc5790112ecc5203f09faac75b333adb13f2c24685dbcf66f64c7e9feddf2ec181f92c6966946f0678c902eb7dad7516b38268b
6
+ metadata.gz: cd1bd74c1f31a555f151463869829ff6189db451571dea01427abf61edbe8601dd94d71050ecac19f774b9ad11f80014098a919c39432e96b62b3cb461d9a678
7
+ data.tar.gz: 9751753eca99dbdb8e5e9e8b69bc70281c850314cb16453e090459938f57a9ab3b560d884c14207fc9b6d8754ede86331563f086583e86db4588fd32071a05dc
data/lib/handle.rb CHANGED
@@ -20,6 +20,8 @@ class Handle
20
20
  end
21
21
 
22
22
  def with(args={})
23
+ args = args.slice(:on_fail)
24
+
23
25
  if success?
24
26
  @returns_pool << yield(@result.return, **options = {})
25
27
  @result.return = @returns_pool.last
@@ -62,6 +64,7 @@ class Handle
62
64
  condition = options[:when].nil? || options[:when]
63
65
  condition_error = options[:error] || options[:not_valid_error] || 'Not Valid!'
64
66
  good_to_go = condition&.respond_to?(:call) ? condition&.call : condition
67
+
65
68
  raise NotValidError, condition_error unless good_to_go
66
69
  end
67
70
  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.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov