From 682ab87c6b1d601ed8a420e79c4c1883ae7f5291 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 16 Oct 2009 11:20:06 +0000 Subject: * lib/delegate.rb (Delegator#method_missing): remove backtrace lines _until_ `method_missing'. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/delegate.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/delegate.rb b/lib/delegate.rb index d8a63660a..da58048f3 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 -- cgit