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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed8c383cd016ad1fceffef1a09ca15f6ba37b25a
4
- data.tar.gz: 2e47f4e4a661ac223269dd4a5f9d9b6b4ce499fa
3
+ metadata.gz: 9a8d1d2fc51037060163ec294e01999a0a5ba28e
4
+ data.tar.gz: ac364d3f04d1a76905da98ff298a6982dd0f4f58
5
5
  SHA512:
6
- metadata.gz: 3cb3c7d4e6ca2dfcb8635b8c1e807bdf481a78c2f0f38b5f1f918571357da80d23e658a01571e0d507bceaf91bc5181df49bccb9e6dbe5c5a5e58454acf476cf
7
- data.tar.gz: 50f386297310f2a5a3c9c6907f00f64a9f923cc094ffd13ba2234ee9d89dae328ca5e934a99cc1e5b6dc4bb2a6fd1090599f7636cae4460c552291854548b253
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/rbreturn_safe_yield.svg)](https://badge.fury.io/rb/return_safe_yield)
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
@@ -1,3 +1,3 @@
1
1
  module ReturnSafeYield
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -48,7 +48,12 @@ module ReturnSafeYield
48
48
  exception = true
49
49
  fail
50
50
  ensure
51
- yield(*first_block_result) unless exception
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.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-13 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler