Class: Kitchen::Terraform::CommandExecutor
- Inherits:
-
Object
- Object
- Kitchen::Terraform::CommandExecutor
- Defined in:
- lib/kitchen/terraform/command_executor.rb
Overview
CommandExecutor is the class of objects which execute Terraform CLI commands.
Instance Method Summary collapse
-
#initialize(client:, logger:) ⇒ Kitchen::Terraform::CommandExecutor
constructor
#initialize prepares a new instance of the class.
-
#run(command:, options:) {|standard_output| ... } ⇒ self
#run executes a client command.
Constructor Details
#initialize(client:, logger:) ⇒ Kitchen::Terraform::CommandExecutor
#initialize prepares a new instance of the class.
29 30 31 32 |
# File 'lib/kitchen/terraform/command_executor.rb', line 29 def initialize(client:, logger:) self.client = client self.logger = logger end |
Instance Method Details
#run(command:, options:) {|standard_output| ... } ⇒ self
#run executes a client command.
43 44 45 46 47 48 49 50 51 |
# File 'lib/kitchen/terraform/command_executor.rb', line 43 def run(command:, options:, &block) ::Kitchen::Terraform::ShellOut.new( command: "#{client} #{command}", logger: logger, options: , ).run(&block) self end |