class Proclib::Commands::Base

Constants

NotYetRunning
NotYetTerminated
STDIN_BUF_SIZE

Attributes

cmdline[R]
env[R]
run_dir[R]
stdin[R]
tag[R]

Public Class Methods

new(tag: nil, cmdline:, env: {}, run_dir: nil, stdin: nil) click to toggle source
# File lib/proclib/commands/base.rb, line 15
def initialize(tag: nil, cmdline:, env: {}, run_dir: nil, stdin: nil)
  @env = env.map {|k,v| [k.to_s, v.to_s]}.to_h
  @cmdline = cmdline
  @tag = tag || cmdline[0..20]
  @run_dir = run_dir
  @stdin = stdin
end

Public Instance Methods

pipes() click to toggle source
# File lib/proclib/commands/base.rb, line 23
def pipes
  @pipes ||= OpenStruct.new
end
result() click to toggle source
# File lib/proclib/commands/base.rb, line 35
def result
  @result || raise(NotYetTerminated)
end
spawn() click to toggle source
# File lib/proclib/commands/base.rb, line 27
def spawn
  raise NotImplementedError
end
wait() click to toggle source
# File lib/proclib/commands/base.rb, line 31
def wait
  raise NotImplementedError
end