return_safe_yield 0.1.3 → 0.2.1

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
- SHA1:
3
- metadata.gz: 7f73d9b9521f322cca377a84aa766a4006f95cc7
4
- data.tar.gz: 96ea5ebb0d4267da8accef740e9bcc10ab968243
2
+ SHA256:
3
+ metadata.gz: f53464c6e6c4889be471da2568c704cc68953f1aa0e1d65127ee1775b453d391
4
+ data.tar.gz: 5a7c19f652074eb2eccd60b1de238d03e1ab1cae8dbd058c18c2a442ea9aa008
5
5
  SHA512:
6
- metadata.gz: e7a9c5064afa37b4fae41e81ad4c87a05bf93dd82eb0a935888c214b6c308348caa02cbaf24a374ee88a12ab6f177092a6d35e470d775fc0a0421e31ecbc56e9
7
- data.tar.gz: 2d8d9fff6fdadb5002c7729bead57897b7609e931ac220d901a664eed62dc91330d0847999fff8caa4d734d1725cef96da8ddd51259076f28a9f5ea9279360ea
6
+ metadata.gz: 1c785ac63a306878d840050c61e1c34da72254308a39f88633277845da910ef0bea7d394b87234e0eb46e0eeaca96320d3bd69973f65481f5993b952639edb12
7
+ data.tar.gz: 6d5553908f7120f49fcc86b5ce4d5a3f920ca9a247bc709e16f20cf77260888f69151ffda87243a401e20378902b828cbf99488eaa183ccbb0a2434319ca59a2
data/README.md CHANGED
@@ -154,6 +154,20 @@ be a safe, welcoming space for collaboration, and contributors are expected to
154
154
  adhere to the [Contributor Covenant](http://contributor-covenant.org) code of
155
155
  conduct.
156
156
 
157
+ ## Changelog
158
+
159
+ ### 0.2.1
160
+
161
+ * Fix returning arrays (previously, only first element was returned)
162
+
163
+ ### 0.2.0
164
+
165
+ * Rescue all exceptions inheriting from `Exception`
166
+
167
+ ### Until 0.1.3
168
+
169
+ * Undocumented releases
170
+
157
171
  ## License
158
172
 
159
173
  The gem is available as open source under the terms of the [MIT
@@ -1,3 +1,3 @@
1
1
  module ReturnSafeYield
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -47,12 +47,12 @@ module ReturnSafeYield
47
47
  first_block_result = first.call(*args)
48
48
  returned = false
49
49
  return first_block_result
50
- rescue
50
+ rescue Exception
51
51
  exception = true
52
52
  fail
53
53
  ensure
54
54
  unless exception
55
- second_block_result = yield(*first_block_result)
55
+ second_block_result = yield(first_block_result)
56
56
 
57
57
  # In this very particular case, using `return` inside of `ensure`
58
58
  # is fine as we're checking if there is an exception. There is no other
@@ -83,7 +83,7 @@ module ReturnSafeYield
83
83
  result = block.call(*args, &cb)
84
84
  state = :regular
85
85
  return result
86
- rescue
86
+ rescue Exception
87
87
  state = :exception
88
88
  fail
89
89
  ensure
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: return_safe_yield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Remo Fritzsche
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-14 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.6.6
97
+ rubygems_version: 3.0.3.1
99
98
  signing_key:
100
99
  specification_version: 4
101
100
  summary: Provides helpers for dealing with `return` statements in blocks and procs.'