DEV: Add pry-byebug and optionally require pry behind a ENV var for better spec debugging (PR #9984)

We removed pry-nav a while back because it is not up to date with pry but it is super useful. Luckily pry-byebug is here to save us all from Satan’s power.

To get this to work you need to add the following to your $HOME/.pryrc file.

if defined?(PryByebug)
  Pry.commands.alias_command 'c', 'continue'
  Pry.commands.alias_command 's', 'step'
  Pry.commands.alias_command 'n', 'next'
  Pry.commands.alias_command 'f', 'finish'
end

Pry::Commands.command /^$/, "repeat last command" do
  pry_instance.run_command Pry.history.to_a.last
end

The require-ing of pry, pry-rails, and pry-byebug in specs is controlled by the IMPROVED_SPEC_DEBUGGING flag (disabled by default).

GitHub

The title of this pull request changed from “Add pry-byebug and optionally require pry behind a ENV var” to "DEV: Add pry-byebug and optionally require pry behind a ENV var

The title of this pull request changed from “DEV: Add pry-byebug and optionally require pry behind a ENV var” to "DEV: Add pry-byebug and optionally require pry behind a ENV var for better spec debugging