Class: Kward::Sandbox::UnavailableRunner
- Inherits:
-
CommandRunner
- Object
- CommandRunner
- Kward::Sandbox::UnavailableRunner
- Defined in:
- lib/kward/sandbox/unavailable_runner.rb
Overview
Fails closed rather than running a requested sandbox policy unrestricted.
Instance Attribute Summary
Attributes inherited from CommandRunner
Instance Method Summary collapse
- #command_argv(command, cwd:) ⇒ Object
- #run(command, cwd:, timeout_seconds:, max_output_bytes:, cancellation: nil, &block) ⇒ Object
Methods inherited from CommandRunner
Constructor Details
This class inherits a constructor from Kward::Sandbox::CommandRunner
Instance Method Details
#command_argv(command, cwd:) ⇒ Object
12 13 14 |
# File 'lib/kward/sandbox/unavailable_runner.rb', line 12 def command_argv(command, cwd:) [] end |
#run(command, cwd:, timeout_seconds:, max_output_bytes:, cancellation: nil, &block) ⇒ Object
16 17 18 |
# File 'lib/kward/sandbox/unavailable_runner.rb', line 16 def run(command, cwd:, timeout_seconds:, max_output_bytes:, cancellation: nil, &block) raise UnavailableError, "Sandbox #{policy.mode} is unavailable: #{capabilities.reason}" end |