Module: RubiGen::Lookup::ClassMethods

Module | RubiGen::Lookup::ClassMethods
In: | lib/rubigen/lookup.rb

### Methods

append_sources application_sources filtered_sources instance lookup prepend_sources reset_sources sources use_application_sources! use_component_sources!

### Public Instance methods

append_sources(*args)

Add a source to the end of the list.

application_sources(filters = [])
filtered_sources(filters)
instance(generator_name, args = [], runtime_options = {})

Convenience method to lookup and instantiate a generator.

lookup(generator_name)

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

prepend_sources(*args)

Add a source to the beginning of the list.

reset_sources()

Reset the source list.

sources()

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

use_application_sources!(*filters)

Use application generators (app, ?).

use_component_sources!(*filters)

Use component generators (test_unit, etc).

1. Current application. If APP_ROOT is defined we know we‘re generating in the context of this application, so search APP_ROOT/generators.
2. User home directory. Search ~/.rubigen/generators.
3. RubyGems. Search for gems containing /{scope}_generators folder.
4. Builtins. None currently.

Search can be filtered by passing one or more prefixes. e.g. use_component_sources!(:rubygems) means it will also search in the following folders:

1. User home directory. Search ~/.rubigen/rubygems_generators.
2. RubyGems. Search for gems containing /rubygems_generators folder.

[Validate]