Module: Ripl::Rc::StripBacktrace

Includes:
U
Defined in:
lib/ripl/rc/strip_backtrace.rb

Defined Under Namespace

Modules: Imp

Instance Method Summary collapse

Methods included from U

included

Methods included from Ripl::Rc::SqueezeHistory::Imp

#squeeze_history

Methods included from Imp

#cwd, #home, #snip, #strip_backtrace

Methods included from Anchor::Imp

#short_inspect

Methods included from Color::Imp

#black, #blue, #color, #colors, #cyan, #find_color, #green, #magenta, #red, #reset, #white, #yellow

Instance Method Details

#format_error(e) ⇒ Object

strip backtrace until ripl



8
9
10
11
12
# File 'lib/ripl/rc/strip_backtrace.rb', line 8

def format_error e
  return super if StripBacktrace.disabled?
  message, backtrace = get_error(e, U.strip_backtrace(e, @name))
  "#{message}\n  #{backtrace.join("\n  ")}"
end

#get_error(e, backtrace = e.backtrace) ⇒ Object



14
15
16
17
# File 'lib/ripl/rc/strip_backtrace.rb', line 14

def get_error e, backtrace=e.backtrace
  return super if StripBacktrace.disabled?
  ["#{e.class}: #{e.message}", backtrace]
end