问题
Pry goes into interactive mode if it encounters an exception (eg if you just put an undefined variable 'x' at the end of the script).
(Also if, inside the script itself you require 'pry'
and put binding.pry
at the point you want to go interactive at.)
But I'm wondering: Is there's some kind of flag/option/argument thingy that I can add to the pry example.rb
command when I enter it at the command prompt, so it will go interactive when it reaches the end of executing any example.rb
script, regardless of what's inside? (Assuming no exceptions before the end, of course.)
(This would obviously be especially useful for use with editors that you can run external programs from like Notepad++, see this and this.)
回答1:
Not yet, but file an issue and i'll add it :)
来源:https://stackoverflow.com/questions/16212147/ruby-pry-can-i-add-something-to-the-command-pry-example-rb-so-pry-automatica