Exception: Exception

Defined in:
lib/stick/units/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with_clean_backtrace(regex) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/stick/units/base.rb', line 44

def self.with_clean_backtrace(regex)
  begin
    yield
  rescue ::Exception
    $!.clean_backtrace(regex).clean_backtrace("with_clean_backtrace") if not $DEBUG
    raise
  end
end

Instance Method Details

#clean_backtrace(regex) ⇒ Object



38
39
40
41
42
# File 'lib/stick/units/base.rb', line 38

def clean_backtrace(regex)
  regex = /^#{::Regexp.escape(__FILE__)}:\d+:in `#{::Regexp.escape(regex)}'$/ if regex.is_a? ::String
  set_backtrace(backtrace.reject { |a| regex =~ a })
  self
end