Sandbox
sandbox.exec()
Example
Example
Parameters
commandStringExecutable to run.
argsArray<String>Command arguments; defaults to an empty array.
cwdStringGuest working directory.
userStringGuest user.
envHashEnvironment variables.
timeoutNumericFinite, non-negative timeout in seconds.
stdinString | :null | :pipeInput bytes or stdin mode. Ruby does not expose a writable streaming handle.
ttyBooleanAllocate a pseudo-terminal.
rlimitsHashResource names mapped to non-negative integer limits.
Returns
ExecOutput
Collected stdout, stderr, and exit status.
sandbox.shell()
Example
Example
exec().
Parameters
scriptStringShell script to execute.
optionsHashThe cwd, user, env, timeout, stdin, tty, and rlimits options documented above.
Returns
ExecOutput
Collected stdout, stderr, and exit status.
sandbox.logs()
Example
Example
Parameters
tailIntegerOptional maximum number of recent entries.
sourcesArray<Symbol | String>Optional filter: stdout, stderr, output, or system.
Returns
Array<LogEntry>
Collected log entries.
ExecOutput
output.stdout
Returns
String
Collected output bytes.
output.stderr
Returns
String
Collected output bytes.
output.stdout_bytes
Returns
String
Binary output aliases.
output.stderr_bytes
Returns
String
Binary output aliases.
output.exit_code
Returns
Integer
Process exit code.
output.success?
Returns
Boolean
Whether execution succeeded.
output.to_h()
Returns
Hash
String keys: stdout, stderr, exit_code, success.
LogEntry
entry.timestamp
Returns
String
RFC 3339 timestamp
entry.source
Returns
String
Log source
entry.data
Returns
String
Raw log bytes
entry.to_h()
Returns
Hash
String keys matching the members above