Class: CommandRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/util/command_runner.rb

Instance Method Summary collapse

Instance Method Details

#run(command, dir) ⇒ Array

Executes a shell command in a specified directory. This is wrapped in a class to make it easy to mock in tests.

Parameters:

  • command (String) —

    The shell command to execute.

  • dir (String) —

    The directory to execute the command in.

Returns:

  • (Array) —

    A tuple containing the output and the status object.



9
10
11
# File 'lib/util/command_runner.rb', line 9

def run(command, dir)
  Open3.capture2e(command, chdir: dir)
end