Method: Trooper::Action#call

Defined in:
lib/trooper/action.rb

#call(configuration) ⇒ Object Also known as: execute

Public: Eval’s the block passed on initialize.

configuration - The configuration object to be used for block eval.

Examples

@action.call(config_object) # => ['touch file']

Returns an array of commands(strings).



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/trooper/action.rb', line 42

def call(configuration)
  @config = configuration
  @call_count += 1

  if everything_ok? && continue_call?
    reset_commands!
    
    build_commands
    commands
  else
    reset_commands!
  end
end