Module: CommandIssuer

Defined in:
lib/get/commons/command_issuer.rb

Overview

Module for simplify command execution.

Defined Under Namespace

Classes: CommandResult

Class Method Summary collapse

Class Method Details

.run(executable, *args) ⇒ Object



36
37
38
39
40
41
# File 'lib/get/commons/command_issuer.rb', line 36

def self.run(executable, *args)
  full_path_executable = CommandIssuer.send(:find, executable)
  command = [full_path_executable, *args].join(' ').strip
  output, error, status = Open3.capture3(command)
  CommandResult.new(command, status.exitstatus, output, error)
end