Class: Trooper::Actions::DefaultAction

Inherits:
Trooper::Action show all
Defined in:
lib/trooper/actions/default_action.rb

Class Attribute Summary collapse

Attributes inherited from Trooper::Action

#block, #commands, #config, #description, #name, #options

Instance Method Summary collapse

Methods inherited from Trooper::Action

#call, #method_missing, #prerequisite_call, #reset_commands!, #run, #type

Methods included from DSL::Bundler

#bundle_exec, #bundle_install, #rake

Methods included from DSL::Rake

#rake

Methods included from DSL::Folders

#cd, #create_folder, #create_folders, #delete_folder

Constructor Details

#initialize(config = {}) ⇒ DefaultAction

Returns a new instance of DefaultAction.



19
20
21
22
23
24
25
26
# File 'lib/trooper/actions/default_action.rb', line 19

def initialize(config = {})
  @name = self.class.config[:name]
  @description = self.class.config[:description]
  @options = self.class.config[:options] || {}
  @config = config
  @call_count = 0
  @commands = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Trooper::Action

Class Attribute Details

.configObject

Returns the value of attribute config.



9
10
11
# File 'lib/trooper/actions/default_action.rb', line 9

def config
  @config
end

Instance Method Details

#ok?Boolean

Always returns true because default actions are loaded before the troopfile, so varibles will always be missing.

Returns:

  • (Boolean)


31
32
33
# File 'lib/trooper/actions/default_action.rb', line 31

def ok?
  true
end