with 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/with.rb +4 -9
  2. metadata +2 -2
data/lib/with.rb CHANGED
@@ -26,15 +26,10 @@ module Kernel
26
26
  exception = e
27
27
  end
28
28
 
29
- if objects.length == 1
30
- if objects.first.respond_to? :__exit__
31
- objects.first.__exit__ exception
32
- else
33
- raise exception if exception
34
- end
35
- else
36
- raise exception if exception
37
- end
29
+
30
+ raise exception if objects.none? {|object|
31
+ object.respond_to?(:__exit__) && object.__exit__(exception)
32
+ } && exception
38
33
 
39
34
  result
40
35
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: with
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - meh.
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-27 00:00:00 Z
13
+ date: 2011-08-28 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: