1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Fix pry-backtrace with Pry.start, improve docs. [Fixes #379]

This commit is contained in:
Conrad Irwin 2012-01-20 01:08:28 -08:00
parent 9c6eaafc04
commit 5ef817cc75
2 changed files with 10 additions and 2 deletions

View file

@ -168,7 +168,12 @@ class Pry
banner <<-BANNER
Usage: pry-backtrace [OPTIONS] [--help]
Show the backtrace for the Pry session.
Show the backtrace for the position in the code where Pry was started. This can be used to
infer the behavior of the program immediately before it entered Pry, just like the backtrace
property of an exception.
(NOTE: if you are looking for the backtrace of the most recent exception raised,
just type: `_ex_.backtrace` instead, see https://github.com/pry/pry/wiki/Special-Locals)
e.g: pry-backtrace
BANNER

View file

@ -113,7 +113,10 @@ class Pry
pry_instance = new(options)
# save backtrace
pry_instance.backtrace = caller.tap(&:shift)
pry_instance.backtrace = caller
# if Pry was started via binding.pry, elide that from the backtrace.
pry_instance.backtrace.shift if pry_instance.backtrace.first =~ /pry.*core_extensions.*pry/
# yield the binding_stack to the hook for modification
pry_instance.exec_hook(