cldwalker/ripl-commands — pull request #2 by postmodern (2012-11-25 03:28:17+00:00)
Title: Editor improvements

I wrote a similar editor command for [ronin](https://github.com/ronin-ruby/ronin/blob/master/lib/ronin/ui/console/commands.rb#L71-L80) and am thinking of replacing it with ripl-commands. So I back-ported a few of my improvements.

* Use `ripl-editor` as the tempfile name.
* Use the `.rb` extension for the tempfile, so the editor will use Ruby syntax highlighting / indentation.
* Expect `ENV['EDITOR']` to always be a program name or path.
* Raise an exception if `ENV['EDITOR']` is not set. Defaulting to `vim` might annoy user's who prefer `nano` or `emacs`.

Cherry-pick what you like.