Toon’s pry configuration


Pry

This file configures pry, the enhanced REPL for ruby.

Debugging

Stepping code

Enable short commands for stepping around while debugging.

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

Repeat last command

Press ENTER will repeat the last command over again. Very convenient to step several lines of code.

# Hit Enter to repeat last command
Pry::Commands.command /^$/, "repeat last command" do
  _pry_.run_command Pry.history.to_a.last
end