with 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/with.rb +7 -2
- data/lib/with/io.rb +1 -1
- metadata +27 -33
data/lib/with.rb
CHANGED
@@ -26,9 +26,14 @@ module Kernel
|
|
26
26
|
exception = e
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
29
|
raise exception if objects.none? {|object|
|
31
|
-
object.respond_to?(:__exit__)
|
30
|
+
next unless object.respond_to?(:__exit__)
|
31
|
+
|
32
|
+
if object.method(:__exit__).arity == 0
|
33
|
+
object.__exit__ && false
|
34
|
+
else
|
35
|
+
object.__exit__(exception)
|
36
|
+
end
|
32
37
|
} && exception
|
33
38
|
|
34
39
|
result
|
data/lib/with/io.rb
CHANGED
metadata
CHANGED
@@ -1,56 +1,50 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: with
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 0.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- meh.
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
12
|
+
date: 2011-09-01 00:00:00.000000000 +02:00
|
13
|
+
default_executable:
|
14
14
|
dependencies: []
|
15
|
-
|
16
|
-
description:
|
15
|
+
description:
|
17
16
|
email: meh@paranoici.org
|
18
17
|
executables: []
|
19
|
-
|
20
18
|
extensions: []
|
21
|
-
|
22
19
|
extra_rdoc_files: []
|
23
|
-
|
24
|
-
files:
|
20
|
+
files:
|
25
21
|
- lib/with.rb
|
26
22
|
- lib/with/io.rb
|
27
23
|
- lib/with/adapters.rb
|
24
|
+
has_rdoc: true
|
28
25
|
homepage: http://github.com/meh/ruby-with
|
29
26
|
licenses: []
|
30
|
-
|
31
|
-
post_install_message:
|
27
|
+
post_install_message:
|
32
28
|
rdoc_options: []
|
33
|
-
|
34
|
-
require_paths:
|
29
|
+
require_paths:
|
35
30
|
- lib
|
36
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
37
36
|
none: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
43
42
|
none: false
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: "0"
|
48
43
|
requirements: []
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
signing_key:
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 1.5.1
|
46
|
+
signing_key:
|
53
47
|
specification_version: 3
|
54
48
|
summary: Stupid Python-like with statement
|
55
49
|
test_files: []
|
56
|
-
|
50
|
+
...
|