Hacker News new | ask | show | jobs
by banister 5148 days ago
The Pry editor feature can do a few things that are impossible in IRB (but correct me if i'm wrong) --- you can call up an editor in the MIDDLE of an incomplete expression, this is only possible because Pry commands are not methods - see here: https://github.com/pry/pry/wiki/User-Input#wiki-Edit_input_b...

Other things the Pry editor feature can do that i haven't seen elsewhere: it can edit methods (`edit-method MyClass#my_method`), it can open up an editor directly on the file/line that caused the last exception (`edit --ex`), it can edit previous expressions (`edit -i EXPR`).

Your interactive_editor gem was inspiration for this though, a very nice little gem :)

1 comments

Another approach to editing your code while working in the REPL is to simply send code from your editor to the browser. I recently wrote a blog post about setting vim up for this: http://alanmacdougall.com/blog/2012/03/27/using-vim-slime-wi...