Rails::Generator::Commands::Base


Files

Parent

DelegateClass(Rails::Generator::Base)

Description

Generator commands delegate Rails::Generator::Base and implement a standard set of actions. Their behavior is defined by the way they respond to these actions: Create brings life; Destroy brings death; List passively observes.

Commands are invoked by replaying (or rewinding) the generator‘s manifest of actions. See Rails::Generator::Manifest and Rails::Generator::Base#manifest method that generator subclasses are required to override.

Commands allows generators to "plug in" invocation behavior, which corresponds to the GoF Strategy pattern.

Methods

Public Instance methods

class_collisions (*class_names)

Does nothing for all commands except Create.

dependency (generator_name, args, runtime_options = {})

invoke! ()

Replay action manifest. RewindBase subclass rewinds manifest.

readme (*args)

Does nothing for all commands except Create.

Protected Instance methods

current_migration_number ()

existing_migrations (file_name)

gsub_file (relative_destination, regexp, *args, &block)

migration_directory (relative_path)

migration_exists? (file_name)

next_migration_number ()

next_migration_string (padding = 3)