return_safe_yield 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/return_safe_yield/version.rb +1 -1
- data/lib/return_safe_yield.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a8d1d2fc51037060163ec294e01999a0a5ba28e
|
4
|
+
data.tar.gz: ac364d3f04d1a76905da98ff298a6982dd0f4f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 358b653afe13a86fc382ca8f5d309ac08c794f80a30207eeb1072afe2759ac26e458cdb2f8b303235fdad4dd081bdabbbf4276082dffbefa751fc14697b1a141
|
7
|
+
data.tar.gz: efc7867b9e5cd3a988e75d873eb74cec8b9cc50c4d8434369a2468fb918b8c292694e6d04128ed6c9a01ad99de30bae208f80928542a777797cfa931efa1fe1a
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# return_safe_yield
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/
|
4
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/return_safe_yield.svg)](https://badge.fury.io/rb/return_safe_yield)
|
5
4
|
[![Build Status](https://travis-ci.org/remofritzsche/return_safe_yield.svg?branch=master)](https://travis-ci.org/remofritzsche/return_safe_yield)
|
6
5
|
|
7
6
|
Provides helpers for dealing with `return` statements in blocks
|
data/lib/return_safe_yield.rb
CHANGED
@@ -48,7 +48,12 @@ module ReturnSafeYield
|
|
48
48
|
exception = true
|
49
49
|
fail
|
50
50
|
ensure
|
51
|
-
|
51
|
+
unless exception
|
52
|
+
# In this very particular case, using `return` inside of `ensure`
|
53
|
+
# is fine as we're checking if there is an exception. There is no other
|
54
|
+
# way of returning the second block's result otherwise.
|
55
|
+
return yield(*first_block_result)
|
56
|
+
end
|
52
57
|
end
|
53
58
|
end
|
54
59
|
|
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.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|