Context Attributes - mosop/run GitHub Wiki

command

A command name as a String. If it is specified multiple times in nested contexts, the nearest one is used.

args

Arguments as an Array(String). If it is specified multiple times in nested contexts, all the values are concatenated from the outer context.

env

Environment variables as a Hash(String, String). If it is specified multiple times in nested contexts, all the values are merged from the outer context.

clear_env

A Bool that specifies whether to pass the current environment variables to runner processes. If true, the variables are not passed. If it is specified multiple times in nested contexts, the nearest one is used. The default value is false.

input, output, error

IOs passed to runner processes.

The types are:

  • Run::Io::PIPE: a new pipe
  • an arbitrary IO object
  • true or Run::Io::PARENT: the standard IO of the parent process of a running process (STDIN/STDOUT/STDERR)
  • false or Run::Io::NULL: no IO (/dev/null)

If it is specified multiple times in nested contexts, the nearest one is used. The default value is true.

shell

A Bool that specifies whether to run commands in the system's shell. If it is specified multiple times in nested contexts, the nearest one is used. The default value is true.

chdir

A working directory's path as a String. If it is specified multiple times in nested contexts, all the paths are concatenated from the outer context. Relative paths are resolved.

parallel

A Bool that specifies whether to run child commands asynchronously. Even if it is specified in parent contexts, the current value is used. The default value is false.

Note: This attribute is only for command groups.

abort_on_error

A Bool that specifies whether to abort all existing processes when the process returns an error. If it is specified multiple times in nested contexts, the nearest one is used. The default value is false.

abort_timeout

Specifies how is waited for each process to be killed when an abort is occurred.

The types are:

  • an N value of Number::Primitive: waits for N seconds
  • Run::Timeout::INFINITE: waits forever
  • Run::Timeout::NO_WAIT: never waits

If it is specified multiple times in nested contexts, the nearest one is used. The default value is Run::Timeout::NO_WAIT.