generator

generator(args=self.default_arguments, options={}, config={}) Instance Public methods Instantiate the generator.

run_generator

run_generator(args=self.default_arguments, config={}) Instance Public methods Runs the generator configured for this class. The first argument is an array like command line arguments: class AppGeneratorTest < Rails::Generators::TestCase tests AppGenerator destination File.expand_path("../tmp", File.dirname(__FILE__)) teardown :cleanup_destination_root test "database.yml is not created when skipping Active Record" do run_generator %w(myapp --skip-active-record) a

fallbacks

fallbacks() Class Public methods Hold configured generators fallbacks. If a plugin developer wants a generator group to fallback to another group in case of missing generators, they can add a fallback. For example, shoulda is considered a test_framework and is an extension of test_unit. However, most part of shoulda generators are similar to test_unit ones. Shoulda then can tell generators to search for test_unit generators when some of them are not available by adding a fallback:

help

help(command = 'generate') Class Public methods Show help message with available generators.

hidden_namespaces

hidden_namespaces() Class Public methods

hide_namespace

hide_namespace(*namespaces) Class Public methods Alias for: hide_namespaces

hide_namespaces

hide_namespaces(*namespaces) Class Public methods Also aliased as: hide_namespace

invoke

invoke(namespace, args=ARGV, config={}) Class Public methods Receives a namespace, arguments and the behavior to invoke the generator. It's used as the default entry point for generate, destroy and update commands.

no_color!

no_color!() Class Public methods Remove the color from output.

subclasses

subclasses() Class Public methods Track all generators subclasses.