Shell Adapter

A very simpler wrapper around the fiddliness of interacting with shell commands in Ruby. Extracted from Ministry of Justice's "FormBuilder Publisher".

Usage

Commands executed with ShellAdapter will inherit the environment of their parent process (i.e. the running Ruby process), including PATH.

# run a command with arguments, discarding the output:
ShellAdapter.exec(cmd, arg1, arg2, ....)
# e.g.
ShellAdapter.exec('cp', file_path_1, file_path_2)