Class

Rails::Generator::Commands::Base

Inheritance
< DelegateClass(Rails::Generator::Base)

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

Instance

Visibility Signature
public class_collisions (*class_names)
public dependency (generator_name, args, runtime_options = {})
public invoke! ()
public readme (*args)
protected current_migration_number ()
protected existing_migrations (file_name)
protected gsub_file (relative_destination, regexp, *args, &block)
protected migration_directory (relative_path)
protected migration_exists? (file_name)
protected next_migration_number ()
protected next_migration_string (padding = 3)

Instance Method Detail

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.

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)