Sha256: 296612d49ba1093dd400e5d113db88f93d2fca97ac7593184705f124a9e4be63

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

# this one display full BT with code, at the end [no performance loss]
SCRIPT_LINES__ = {}
at_exit {
 puts "==== "
 if $!
  backtrace_with_code = $!.backtrace.map{|bt| 
   file, line, junk = bt.split(":")
   line = line.to_i - 1 
   actual_file = SCRIPT_LINES__[file]
   actual_line = actual_file[line] if actual_file
   "#{bt}\n\t#{actual_line.strip if actual_line}"
  } 
  puts backtrace_with_code
  puts "===="
 else
  puts "(no exception to backtrace)"
 end
   

}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
backtracer-0.2.0 lib/backtracer.rb
backtracer-0.1.0 lib/backtracer.rb
backtracer-0.0.2 lib/backtracer.rb