diff options
Diffstat (limited to 'lib/delegate.rb')
-rw-r--r-- | lib/delegate.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb index d8a63660a4..da58048f36 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -137,7 +137,9 @@ class Delegator target.__send__(m, *args, &block) end rescue Exception - $@.delete_if{|s| %r"\A#{Regexp.quote(__FILE__)}:\d+:in `method_missing'\z"o =~ s} + if i = $@.index{|s| %r"\A#{Regexp.quote(__FILE__)}:\d+:in `method_missing'\z"o =~ s} + $@[0..i] = [] + end ::Kernel::raise end end |