Class: Consist::Commands::Exec

Inherits:
Object
  • Object
show all
Includes:
Erbable
Defined in:
lib/consist/commands/exec.rb

Instance Method Summary collapse

Methods included from Erbable

#erb_template, included

Constructor Details

#initialize(command) ⇒ Exec

Returns a new instance of Exec.



8
9
10
# File 'lib/consist/commands/exec.rb', line 8

def initialize(command)
  @command = command
end

Instance Method Details

#perform!(executor) ⇒ Object



12
13
14
15
16
17
# File 'lib/consist/commands/exec.rb', line 12

def perform!(executor)
  @command[:commands].each do
    executor.execute(erb_template(_1), interaction_handler: Consist::Commands::StreamLogger.new,
                                       **@command[:params])
  end
end