Skip to content

Instantly share code, notes, and snippets.

@tonymarklove
Created June 5, 2020 09:07
Show Gist options
  • Select an option

  • Save tonymarklove/ab6c056ab6f6cb35345ebc3559d157eb to your computer and use it in GitHub Desktop.

Select an option

Save tonymarklove/ab6c056ab6f6cb35345ebc3559d157eb to your computer and use it in GitHub Desktop.
Pry - Jump up the stack to next application code, ignoring gems
Pry::Commands.command /^up_app$/, "jump up the stack to next application code" do
start_frame = Byebug.current_context.frame.pos + 1
frame = (start_frame...Byebug.current_context.stack_size).find do |index|
!Byebug::Frame.new(Byebug.current_context, index).file.start_with?(Gem.dir)
end
_pry_.run_command "frame #{frame}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment