module Terraform::Binary::Command

This module handles running the actual CLI commands

Public Instance Methods

binary() click to toggle source

Downloads, extracts and returns the path to the binary @return [String] absolute path of the binary

# File lib/terraform/binary/command.rb, line 20
def binary
  e = Executable.new
  e.download
  e.extract
  e.binary
end
run(command) click to toggle source

Runs the given command with `Core::Kernel.system` Example `run('sub-command -var “key=value” -machine-readable')` @param [String] command the full sub-command to run (including cli arguments) @return [String] true or {CommandFailure}

# File lib/terraform/binary/command.rb, line 14
def run(command)
  system("#{binary} #{command}") || (raise CommandFailure)
end