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

StackOverflow https://stackoverflow.com/questions/16212147

質問

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.)

役に立ちましたか?

解決

Not yet, but file an issue and i'll add it :)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top