top domain questions



How to exit all pry breakpoints and add shortcut in terminal in ruby on rails


In ruby or rails project we need sometimes to go over all the breakpoints until the end of the execution.

➜  ~ vim /System/Volumes/Data/Users/batman/.pryrc
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'
  Pry.commands.alias_command 'd', 'disable-pry'
end

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