Module: Trooper::Config::Action

Included in:
Defaults
Defined in:
lib/trooper/config/action.rb

Constant Summary collapse

DEFAULT_ACTIONS =
[Actions::SetupTrooperAction, Actions::PreparePrerequisiteAction,
Actions::CloneRepositoryAction, Actions::InstallGemsAction, 
Actions::MigrateDatabaseAction, Actions::RestartServerAction, 
Actions::RollbackMigrateAction, Actions::SetupDatabaseAction, 
Actions::UpdateRepositoryAction, Actions::PrecompileAssetsAction]

Instance Method Summary collapse

Instance Method Details

#action(name, description = "No Description", options = {}, &block) ⇒ Object



24
25
26
27
28
29
# File 'lib/trooper/config/action.rb', line 24

def action(name, description = "No Description", options = {}, &block)
  action = Trooper::Action.new name, description, options, &block
  action.config = self

  Trooper::Arsenal.actions.add action
end

#load_default_actions!Object



32
33
34
35
36
37
# File 'lib/trooper/config/action.rb', line 32

def load_default_actions!
  DEFAULT_ACTIONS.each do |klass|
    Trooper.logger.debug "loaded #{klass.to_s}"
    Trooper::Arsenal.actions.add klass.new
  end
end