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

Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top