mulligan 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -1
- data/README.md +26 -13
- data/Rakefile +11 -5
- data/lib/mulligan.rb +14 -0
- data/lib/mulligan/condition.rb +13 -4
- data/lib/mulligan/kernel.rb +4 -3
- data/lib/mulligan/kernel_common.rb +1 -1
- data/lib/mulligan/kernel_pure.rb +4 -2
- data/lib/mulligan/version.rb +1 -1
- data/spec/mulligan_spec.rb +156 -111
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e62a4787a90e87a4813e17e7349f7df21e189fd5
|
4
|
+
data.tar.gz: 4729dca38e624e26c7d3e17c14bb5baf270641b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9afd8d4695eddffa042b80bc325697b5171348551e1d8d6afe7b51b819e5da885bb73c232eb0bf84e141bf226dc7c536339e820bcbf1559fe50ccb49adff530d
|
7
|
+
data.tar.gz: 5f521f212960b68e60c2ed9fe87ad9100f1c44925d60e297b70e87efc3b58d865e66ab50e2bc2fec06bddf585b9eb69bbb45fc6c5462852189c2bef6421601b9
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
[![Build Status](https://travis-ci.org/michaeljbishop/mulligan.png?branch=master)](https://travis-ci.org/michaeljbishop/mulligan)
|
2
|
-
|
2
|
+
|
3
|
+
<img src="http://michaeljbishop.github.io/mulligan/images/mulligan-logo.png" height="155" width="440" alt="Mulligan">
|
3
4
|
|
4
5
|
"In golf,...a stroke that is replayed from the spot of the previous stroke without penalty, due to an errant shot made on the previous stroke. The result is, as the hole is played and scored, as if the first errant shot had never been made." -- [Wikipedia](http://en.wikipedia.org/wiki/Mulligan_(games)#Mulligan_in_golf)
|
5
6
|
|
@@ -118,9 +119,8 @@ BTW, Here's your second chance to read [Beyond Exception Handling: Conditions an
|
|
118
119
|
|
119
120
|
You've always known he (or she) knew Lisp and now you have something to ask him about.
|
120
121
|
|
121
|
-
##
|
122
|
-
###
|
123
|
-
#### Kernel#raise
|
122
|
+
## API
|
123
|
+
### Kernel#raise
|
124
124
|
1. `Kernel#raise` now has a return value! It is the value returned from the recovery block.
|
125
125
|
2. `Kernel#raise` also yields the exception to a block. It does this since it's pretty common to have `Kernel#raise` create an exception for you and without this, you couldn't otherwise attach recoveries.
|
126
126
|
|
@@ -143,7 +143,7 @@ returns
|
|
143
143
|
=> "hello"
|
144
144
|
```
|
145
145
|
|
146
|
-
|
146
|
+
### You can pass parameters to Exception#recover
|
147
147
|
The first parameter is always the id of the recovery. The rest will be passed directly to the recovery block. Building on the above example:
|
148
148
|
|
149
149
|
```ruby
|
@@ -165,7 +165,7 @@ returns
|
|
165
165
|
=> 5
|
166
166
|
```
|
167
167
|
|
168
|
-
|
168
|
+
### Your recovery can attach data to be read by the rescue clause
|
169
169
|
You can pass an options hash to the `rescue` clause that is attached to your recovery. This is handy if you want to attach extra data about the recovery or the circumstances in which it is being raised. Pass them as the second parameter in `Exception#set_recovery`. You can retrieve them with `Exception#recovery_options`. Reserved keys are `:summary`, and `:discussion`
|
170
170
|
```ruby
|
171
171
|
raise "Test" do |e|
|
@@ -185,7 +185,7 @@ rescue MisparsedEntryException => e
|
|
185
185
|
... read choice and execute ...
|
186
186
|
```
|
187
187
|
|
188
|
-
|
188
|
+
### Kernel#last_recovery
|
189
189
|
There is a new method: `Kernel#last_recovery` which will return the id of the last recovery invoked for the current thread. So you can do things like this:
|
190
190
|
|
191
191
|
```ruby
|
@@ -197,16 +197,25 @@ rescue Exception => e
|
|
197
197
|
end
|
198
198
|
```
|
199
199
|
|
200
|
-
|
200
|
+
## Supported Rubies
|
201
201
|
|
202
|
-
|
202
|
+
[![Build Status](https://travis-ci.org/michaeljbishop/mulligan.png?branch=master)](https://travis-ci.org/michaeljbishop/mulligan)
|
203
|
+
Mulligan fully supports MRI versions 1.9.3 -> 2.1.1
|
203
204
|
|
204
|
-
|
205
|
+
Mulligan will gracefully degrade to standard exception handling on other platforms.
|
205
206
|
|
206
|
-
###
|
207
|
+
### Compatibility Notes
|
207
208
|
|
208
|
-
|
209
|
-
|
209
|
+
- Code that ***raises*** exceptions and adds recoveries can always remain the same, regardless of the Ruby version.
|
210
|
+
|
211
|
+
- Code that ***rescues*** exceptions will need to either:
|
212
|
+
|
213
|
+
- Call `Exception#recovery_exist?` before calling `Exception#recover`, which is good defensive programming.
|
214
|
+
- Conditionally execute recoveries based on `Mulligan.supported?`
|
215
|
+
|
216
|
+
- If `Exception#recover` is called in a Ruby that doesn't fully support Mulligan, a `Mulligan::UnsupportedException` will be raised. This is to alert the author that execution is not going to jump back into the context where the exception was raised and the code will instead have to behave as if there were no mulligans (standard exception handling).
|
217
|
+
|
218
|
+
## FAQ
|
210
219
|
|
211
220
|
### "Recovery"? What's wrong with "Restart"?
|
212
221
|
|
@@ -214,6 +223,10 @@ I had to make a hard choice about naming the thing that allows an exception to b
|
|
214
223
|
|
215
224
|
Changing the name to a noun subtracts that confusion (though arguably adds some back for those coming from languages where the "restart" name is entrenched).
|
216
225
|
|
226
|
+
### Will Mulligan let me resume from all exceptions?
|
227
|
+
|
228
|
+
No. If an exception didn't have recoveries attached when it was raised, you will not be able to call them. It is incumbent on the code that raises the exception to add the recoveries so they can control the error-handling flow.
|
229
|
+
|
217
230
|
## Influences
|
218
231
|
- [Beyond Exception Handling: Conditions and Restarts](http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html) -- (from [Practical Common Lisp](http://www.gigamonkeys.com/book/))
|
219
232
|
- [Things You Didn't Know About Exceptions](http://avdi.org/talks/rockymtnruby-2011/things-you-didnt-know-about-exceptions.html) (Avdi Grimm)
|
data/Rakefile
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
3
|
|
4
|
-
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
task :default => :spec
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
def supports_mulligan?
|
8
|
+
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" && RUBY_VERSION >= "1.9.3"
|
8
9
|
end
|
9
10
|
|
10
|
-
|
11
|
+
if supports_mulligan?
|
12
|
+
require "rake/extensiontask"
|
11
13
|
|
12
|
-
|
14
|
+
Rake::ExtensionTask.new "mulligan" do |ext|
|
15
|
+
ext.lib_dir = "lib/mulligan"
|
16
|
+
end
|
17
|
+
task :spec => :compile
|
18
|
+
end
|
data/lib/mulligan.rb
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
module Mulligan
|
2
|
+
|
3
|
+
def self.supported?
|
4
|
+
!!(defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" && RUBY_VERSION >= "1.9.3")
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.using_extension?
|
8
|
+
supported?
|
9
|
+
end
|
10
|
+
|
11
|
+
class UnsupportedException < Exception
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
1
15
|
require "mulligan/version"
|
2
16
|
require "mulligan/condition"
|
3
17
|
require "mulligan/kernel"
|
data/lib/mulligan/condition.rb
CHANGED
@@ -17,10 +17,16 @@ module Mulligan
|
|
17
17
|
# :discussion - The complete documentation of this recovery. Please include a
|
18
18
|
# description of the behavior, the return parameter, and any parameters
|
19
19
|
# the recovery can take
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
if Mulligan.supported?
|
21
|
+
def set_recovery(id, options={}, &block)
|
22
|
+
return if block.nil?
|
23
|
+
recoveries[id.to_sym] = options.merge(:block => block)
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
else
|
27
|
+
def set_recovery(id, options={}, &block)
|
28
|
+
nil
|
29
|
+
end
|
24
30
|
end
|
25
31
|
|
26
32
|
# Checks for the presence of a recovery
|
@@ -56,6 +62,8 @@ module Mulligan
|
|
56
62
|
# @param params any additional parameters you want to pass to the recovery block
|
57
63
|
# @return This doesn't actually matter because you can't retrieve it
|
58
64
|
def recover(id, *params)
|
65
|
+
raise Mulligan::UnsupportedException unless Mulligan.supported?
|
66
|
+
|
59
67
|
Thread.current[:__last_recovery__] = nil
|
60
68
|
raise ControlException unless has_recovery?(id.to_sym)
|
61
69
|
data = recoveries[id.to_sym]
|
@@ -65,6 +73,7 @@ module Mulligan
|
|
65
73
|
end
|
66
74
|
Thread.current[:__last_recovery__] = id
|
67
75
|
data[:continuation].call(*data[:block].call(*params))
|
76
|
+
true
|
68
77
|
end
|
69
78
|
|
70
79
|
private
|
data/lib/mulligan/kernel.rb
CHANGED
data/lib/mulligan/kernel_pure.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require "mulligan/kernel_common"
|
2
2
|
|
3
3
|
module Mulligan
|
4
4
|
module Kernel
|
@@ -14,7 +14,8 @@ module Mulligan
|
|
14
14
|
super
|
15
15
|
rescue Exception => e
|
16
16
|
yield e if block_given?
|
17
|
-
|
17
|
+
super(e) unless Mulligan.supported?
|
18
|
+
|
18
19
|
# only use callcc if there are restarts otherwise re-raise it
|
19
20
|
super(e) if e.send(:recoveries).empty?
|
20
21
|
should_raise = true
|
@@ -27,5 +28,6 @@ module Mulligan
|
|
27
28
|
super(e) if should_raise
|
28
29
|
result
|
29
30
|
end
|
31
|
+
|
30
32
|
end
|
31
33
|
end
|
data/lib/mulligan/version.rb
CHANGED
data/spec/mulligan_spec.rb
CHANGED
@@ -15,117 +15,158 @@ describe Mulligan do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'should correctly report included strategies' do
|
18
|
-
outer_test(style){|e|e.has_recovery?(:ignore)}.should
|
18
|
+
outer_test(style){|e|e.has_recovery?(:ignore)}.should eq Mulligan.supported?
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'should correctly report the list of recoveries' do
|
22
|
-
outer_test(style){|e|e.recovery_identifiers}.should
|
22
|
+
outer_test(style){|e|e.recovery_identifiers}.should
|
23
|
+
Mulligan.supported? ?
|
24
|
+
[:ignore, :return_param, :return_all_params, :return_param2, :retry] :
|
25
|
+
be_empty
|
23
26
|
end
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
if Mulligan.supported?
|
29
|
+
context "when Mulligan is supported" do
|
30
|
+
it 'should raise a control exception when invoking a non-existent recovery' do
|
31
|
+
expect { outer_test(style){|e|e.recover :aaa} }.to raise_error(Mulligan::ControlException)
|
32
|
+
end
|
28
33
|
|
29
|
-
|
30
|
-
|
31
|
-
|
34
|
+
it 'should not raise an exception when invoking the ignore recovery' do
|
35
|
+
expect { outer_test(style){|e|e.recover :ignore} }.to_not raise_exception
|
36
|
+
end
|
32
37
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
it 'should return the parameter sent when invoking the return_param recovery' do
|
39
|
+
result = outer_test(style){|e|e.recover(:return_param, 5)}
|
40
|
+
result.should be(5)
|
41
|
+
end
|
37
42
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
+
it 'should return all parameters sent when invoking the return_all_params recovery' do
|
44
|
+
result1, result2 = outer_test(style){|e|e.recover(:return_all_params, 5, 6)}
|
45
|
+
result1.should eq(5)
|
46
|
+
result2.should eq(6)
|
47
|
+
end
|
43
48
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
it "should ignore setting a recovery when passed no block" do
|
52
|
-
expect { outer_test(style){|e|e.recover :no_block} }.to raise_error(Mulligan::ControlException)
|
53
|
-
end
|
49
|
+
context "and follows the continutation to the correct raise" do
|
50
|
+
it 'should return the parameter sent when invoking the return_param recovery' do
|
51
|
+
result = outer_test(style){|e|e.recover(:return_param2, 5)}
|
52
|
+
result.should be(25)
|
53
|
+
end
|
54
|
+
end
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
result = nil
|
59
|
-
expect { result = do_network_task }.to_not raise_error
|
60
|
-
expect(result).to eq(
|
61
|
-
{
|
62
|
-
:users => "json_data",
|
63
|
-
:posts => "json_data",
|
64
|
-
:comments => "json_data"
|
65
|
-
}
|
66
|
-
)
|
67
|
-
end
|
56
|
+
it "should ignore setting a recovery when passed no block" do
|
57
|
+
expect { outer_test(style){|e|e.recover :no_block} }.to raise_error(Mulligan::ControlException)
|
58
|
+
end
|
68
59
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
60
|
+
it "should retrieve the network request without an exception" do
|
61
|
+
@count_of_calls_before_failure = 2
|
62
|
+
|
63
|
+
result = nil
|
64
|
+
expect { result = do_network_task }.to_not raise_error
|
65
|
+
expect(result).to eq(
|
66
|
+
{
|
67
|
+
:users => "json_data",
|
68
|
+
:posts => "json_data",
|
69
|
+
:comments => "json_data"
|
70
|
+
}
|
71
|
+
)
|
75
72
|
end
|
76
|
-
|
77
|
-
|
73
|
+
|
74
|
+
describe "recovery options" do
|
75
|
+
it "should not return the block" do
|
76
|
+
data = nil
|
77
|
+
outer_test(style) do |e|
|
78
|
+
data = e.recovery_options(:return_param)[:block]
|
79
|
+
e.recover(:return_param)
|
80
|
+
end
|
81
|
+
expect(data).to be_nil
|
82
|
+
end
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
it "should not return the continuation" do
|
85
|
+
data = nil
|
86
|
+
outer_test(style) do |e|
|
87
|
+
data = e.recovery_options(:return_param)[:continuation]
|
88
|
+
e.recover(:return_param)
|
89
|
+
end
|
90
|
+
expect(data).to be_nil
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should pass data created in set_recovery" do
|
94
|
+
data = nil
|
95
|
+
outer_test(style) do |e|
|
96
|
+
data = e.recovery_options(:return_param)[:data]
|
97
|
+
e.recover(:return_param)
|
98
|
+
end
|
99
|
+
expect(data).to be(5)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should pass summary created in set_recovery" do
|
103
|
+
data = nil
|
104
|
+
outer_test(style) do |e|
|
105
|
+
data = e.recovery_options(:return_param)[:summary]
|
106
|
+
e.recover(:return_param)
|
107
|
+
end
|
108
|
+
expect(data).to eq("Passes the parameter sent in as the value of the block.")
|
109
|
+
end
|
87
110
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
111
|
+
it "should be read-only" do
|
112
|
+
result = outer_test(style) do |e|
|
113
|
+
e.recovery_options(:return_param)[:new_entry] = 5
|
114
|
+
e.recover(:return_param, e)
|
115
|
+
end
|
116
|
+
expect(result.recovery_options(:return_param)[:new_entry]).to be_nil
|
117
|
+
end
|
93
118
|
end
|
94
|
-
expect(data).to be(5)
|
95
|
-
end
|
96
119
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
120
|
+
if Exception.method_defined?(:cause)
|
121
|
+
it "should support the `#cause` method in the native extension" do
|
122
|
+
begin
|
123
|
+
raise "test"
|
124
|
+
rescue => e
|
125
|
+
begin
|
126
|
+
raise "test2"
|
127
|
+
rescue =>e
|
128
|
+
expect(e.cause.message).to eq "test"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
102
132
|
end
|
103
|
-
|
133
|
+
|
134
|
+
it "should support overriding a recovery and calling the inherited recovery"
|
104
135
|
end
|
136
|
+
else
|
137
|
+
context "when Mulligan is unsupported" do
|
138
|
+
it "should raise an unsupported Exception when invoking a recovery" do
|
139
|
+
expect{Exception.new.recover(:ignore)}.to raise_error(Mulligan::UnsupportedException)
|
140
|
+
end
|
105
141
|
|
106
|
-
|
107
|
-
|
108
|
-
e.recovery_options(:return_param)[:new_entry] = 5
|
109
|
-
e.recover(:return_param, e)
|
142
|
+
it "should not raise an exception when setting a recovery" do
|
143
|
+
expect{Exception.new.set_recovery(:ignore){|p|p}}.to_not raise_error
|
110
144
|
end
|
111
|
-
expect(result.recovery_options(:return_param)[:new_entry]).to be_nil
|
112
|
-
end
|
113
145
|
|
114
|
-
|
115
|
-
|
146
|
+
it "should not set a recovery" do
|
147
|
+
e = Exception.new
|
148
|
+
e.set_recovery(:ignore){|p|p}
|
149
|
+
expect(e.has_recovery?(:ignore)).to be_false
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should not execute the block yielded to raise" do
|
116
153
|
begin
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
raise "test2"
|
121
|
-
rescue =>e
|
122
|
-
expect(e.cause.message).to eq "test"
|
154
|
+
test = true
|
155
|
+
raise "test" do
|
156
|
+
test = false
|
123
157
|
end
|
158
|
+
rescue
|
159
|
+
ensure
|
160
|
+
expect(test).to be_true
|
124
161
|
end
|
125
162
|
end
|
163
|
+
|
164
|
+
it "should list 0 recoveries" do
|
165
|
+
e = Exception.new
|
166
|
+
e.set_recovery(:ignore){|p|p}
|
167
|
+
expect(e.recovery_identifiers).to be_empty
|
168
|
+
end
|
126
169
|
end
|
127
|
-
|
128
|
-
it "should support overriding a recovery and calling the inherited recovery"
|
129
170
|
end
|
130
171
|
end
|
131
172
|
|
@@ -133,25 +174,38 @@ describe Mulligan do
|
|
133
174
|
let(:style){:manual}
|
134
175
|
it_behaves_like "a Mulligan Condition"
|
135
176
|
|
136
|
-
|
137
|
-
t
|
138
|
-
|
139
|
-
|
177
|
+
if Mulligan.supported?
|
178
|
+
it "shouldn't fail when recovering before raising" do
|
179
|
+
t = Exception.new("Test Exception")
|
180
|
+
t.set_recovery(:ignore) {|p|p}
|
181
|
+
expect{t.recover(:ignore)}.to_not raise_error
|
182
|
+
end
|
140
183
|
end
|
141
184
|
end
|
142
185
|
|
143
186
|
shared_examples "raising exceptions" do
|
144
187
|
it_behaves_like "a Mulligan Condition"
|
145
188
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
e
|
189
|
+
if Mulligan.supported?
|
190
|
+
it "should propgate recoveries when raising a pre-existing exception" do
|
191
|
+
t = Exception.new("Test Exception")
|
192
|
+
t.set_recovery(:ignore) {|p|p}
|
193
|
+
begin
|
194
|
+
raise t do |e|
|
195
|
+
e.set_recovery(:return_param){|p|p}
|
196
|
+
end
|
197
|
+
rescue Exception => e
|
198
|
+
expect(e.has_recovery?:ignore).to be_true
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
it "should modify variables in the binding of the raiser" do
|
203
|
+
begin
|
204
|
+
result = scope_test
|
205
|
+
rescue => e
|
206
|
+
e.recover :change
|
152
207
|
end
|
153
|
-
|
154
|
-
expect(e.has_recovery?:ignore).to be_true
|
208
|
+
expect(result).to eq(7)
|
155
209
|
end
|
156
210
|
end
|
157
211
|
|
@@ -173,15 +227,6 @@ describe Mulligan do
|
|
173
227
|
end
|
174
228
|
end
|
175
229
|
|
176
|
-
it "should modify variables in the binding of the raiser" do
|
177
|
-
begin
|
178
|
-
result = scope_test
|
179
|
-
rescue => e
|
180
|
-
e.recover :change
|
181
|
-
end
|
182
|
-
expect(result).to eq(7)
|
183
|
-
end
|
184
|
-
|
185
230
|
context "when raise is called with no arguments" do
|
186
231
|
it "should raise $! when $! is not nil" do
|
187
232
|
begin
|
@@ -210,10 +255,10 @@ describe Mulligan do
|
|
210
255
|
end
|
211
256
|
end
|
212
257
|
|
213
|
-
it "should raise
|
214
|
-
expect
|
215
|
-
raise
|
216
|
-
|
258
|
+
it "should raise an error when called with two strings" do
|
259
|
+
expect do
|
260
|
+
raise("hello", "world")
|
261
|
+
end.to raise_error
|
217
262
|
end
|
218
263
|
|
219
264
|
it "should, when called with a Exception subclassclass, raise that subclass" do
|
@@ -290,7 +335,7 @@ def core_test(style)
|
|
290
335
|
raise t do |e|
|
291
336
|
e.set_recovery(:ignore){|p|p}
|
292
337
|
e.set_recovery(:no_block)
|
293
|
-
e.set_recovery(:return_param, data
|
338
|
+
e.set_recovery(:return_param, :data => 5, :summary => "Passes the parameter sent in as the value of the block."){|p|p}
|
294
339
|
e.set_recovery(:return_all_params){|*p|next *p}
|
295
340
|
e.set_recovery(:return_param2){|p|p}
|
296
341
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mulligan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- michaeljbishop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake-compiler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: |
|
@@ -77,9 +77,9 @@ extensions:
|
|
77
77
|
- ext/mulligan/extconf.rb
|
78
78
|
extra_rdoc_files: []
|
79
79
|
files:
|
80
|
-
- .gitignore
|
81
|
-
- .rspec
|
82
|
-
- .travis.yml
|
80
|
+
- ".gitignore"
|
81
|
+
- ".rspec"
|
82
|
+
- ".travis.yml"
|
83
83
|
- Gemfile
|
84
84
|
- LICENSE.txt
|
85
85
|
- README.md
|
@@ -106,17 +106,17 @@ require_paths:
|
|
106
106
|
- lib
|
107
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - ~>
|
109
|
+
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '2.0'
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.2.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Adds restarts to Ruby's Exception class (similar to LISP Conditions)
|