Class: RubiGen::Commands::Base

Class | RubiGen::Commands::Base
In: | lib/rubigen/commands.rb
Parent: | DelegateClass(RubiGen::Base)

Generator commands delegate RubiGen::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 RubiGen::Manifest and RubiGen::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

class_collisions current_migration_number dependency existing_migrations gsub_file invoke! migration_directory migration_exists? next_migration_number next_migration_string readme write_manifest

### 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.

write_manifest()

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)

[Validate]