Ruby, pry: Can I add something to the command `pry example.rb` so pry automatically goes interactive when it finishes executing the script?

混江龙づ霸主 提交于 2019-12-11 00:47:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!