Pry-settings-for-debug

pry 補追

pry によるデバッグのための .pryrc 設定補追

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# https://github.com/pry/pry/wiki/FAQ#wiki-hirb
require 'hirb'

Hirb.enable

old_print = Pry.config.print
Pry.config.print = proc do |output, value|
  Hirb::View.view_or_page_output(value) || old_print.call(output, value)
end

Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'

この他、binding.pry を利用したデバッグから一気に抜けたい場合、exit-process または exit-program コマンドを利用する。