Module Rails::Generator::Lookup::ClassMethods
In: lib/rails_generator/lookup.rb

Methods

Public Instance methods

Add a source to the end of the list.

Convenience method to lookup and instantiate a generator.

Lookup knows how to find generators’ Specs from a list of Sources. Searches the sources, in order, for the first matching name.

Add a source to the beginning of the list.

Reset the source list.

The list of sources where we look, in order, for generators.

Use application generators (app, ?).

Use component generators (model, controller, etc).

  1. Rails application. If RAILS_ROOT is defined we know we‘re generating in the context of a Rails application, so search RAILS_ROOT/generators.
  2. User home directory. Search ~/.rails/generators.
  3. RubyGems. Search for gems named *_generator.
  4. Builtins. Model, controller, mailer, scaffold.

[Validate]