rails/rails — pull request #8553 by ndbroadbent (2012-12-18 23:59:56+00:00)
Title: Added --editor (-e) option to open all generated & copied files in the user's editor

This is an updated version of #5829, with [@rafaelfranca's proposal to make it higher level](https://github.com/rails/rails/pull/5829#issuecomment-7098334).

The `--editor` option is now aliased as `-e`, and is available for all generators that inherit from `Rails::Generators::Base`. The default editor is now `GUI_EDITOR`, and falls back to `EDITOR`.

It wraps Thor's `template` and `copy_file` actions, and opens generated/copied files in your text editor if `options["editor"]` is present.