rails/rails — pull request #3501 by sinisterchipmunk (2011-11-03 14:53:12+00:00)
Title: make the location of USAGE file configurable

Imagine this scenario:

Lots of generators:

lib/generators/foo/bar/bar_generator.rb
lib/generators/baz/bab/bab_generator.rb

... some of which reuse the same templates in different contexts. So they set a common source_root to `lib/generators/templates`.

Rails will look for a usage file in `lib/generators/USAGE` and will use the same usage file for both generators! Not necessarily a good thing!

This pull request exposes a `usage_file` class method on `Generator::Base` to allow explicitly setting the location of the usage file.