Class: Brut::CLI::Apps::DB::Rebuild

Inherits:
Commands::CompoundCommand show all
Defined in:
lib/brut/cli/apps/db.rb

Instance Attribute Summary

Attributes inherited from Commands::BaseCommand

#parent_command

Instance Method Summary collapse

Methods inherited from Commands::CompoundCommand

#execute, #initialize

Methods inherited from Commands::BaseCommand

#accepts, #args_description, #argv, #commands, #delegate_to_command, #detailed_description, #env, #env_vars, #execute, #name, #options, #print, #puts, #run, #stdin, #system!, #theme

Constructor Details

This class inherits a constructor from Brut::CLI::Commands::CompoundCommand

Instance Method Details

#bootstrap?Boolean

Returns:

  • (Boolean)


281
# File 'lib/brut/cli/apps/db.rb', line 281

def bootstrap? = false

#default_rack_envObject



280
# File 'lib/brut/cli/apps/db.rb', line 280

def default_rack_env = "development"

#descriptionObject



279
# File 'lib/brut/cli/apps/db.rb', line 279

def description = "Drop, re-create, and run migrations, effecitvely rebuilding the entire database"

#optsObject



282
283
284
# File 'lib/brut/cli/apps/db.rb', line 282

def opts = [
  [ "--seed", "Load seed data after rebuild" ]
]

#sub_commands(execution_context) ⇒ Object



285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/brut/cli/apps/db.rb', line 285

def sub_commands(execution_context)
  default_commands = [
    Drop.new,
    Create.new,
    Migrate.new,
  ]
  if execution_context.options.seed?
    default_commands + [ Seed.new ]
  else
    default_commands
  end
end