Skip to content
Kward Search API index

Class: Kward::Sandbox::UnavailableRunner

Inherits:
CommandRunner show all
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

#capabilities, #policy

Instance Method Summary collapse

Methods inherited from CommandRunner

#initialize

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

Raises:



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