JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.31k stars 54 forks source link

Use backtrace location #57

Closed JoshCheek closed 7 years ago

JoshCheek commented 9 years ago

It contains all the info we parse out of the lines of the backtrace. But I need to go back and see how long that has been a thing (ie needs to work on 1.9.3)

(raise 'omg' rescue $!).backtrace_locations.first.tap { |btl|
  btl.lineno        # => 1
  btl.label         # => "<main>"
  btl.base_label    # => "<main>"
  btl.path          # => "/var/folders/7g/mbft22555w3_2nqs_h1kbglw0000gn/T/seeing_is_believing_temp_dir20150330-70943-rcok8r/program.rb"
  btl.absolute_path # => "/private/var/folders/7g/mbft22555w3_2nqs_h1kbglw0000gn/T/seeing_is_believing_temp_dir20150330-70943-rcok8r/program.rb"
}
JoshCheek commented 8 years ago

backtrace_locations doesn't work on 1.9.3, but 1.9.3 has been EOL'd... maybe drop support in v3? IDK, maybe it's fine as it is.

ckib16 commented 7 years ago

Moved to Wiki under https://github.com/JoshCheek/seeing_is_believing/wiki/Potential-future-features