Sha256: 722a0132c37f977ac84933475d09aa7bd24f7f97f8e36d5cfb29e43152ac6a6c
Contents?: true
Size: 528 Bytes
Versions: 385
Compression:
Stored size: 528 Bytes
Contents
# frozen_string_literal: true module EacRubyUtils module Envs class Spawn attr_reader :command, :pid def initialize(command) @command = command @pid = ::Process.spawn(command) end def kill(signal) ::Process.kill(signal, pid) end def kill_at_end(&block) block.call(self) ensure kill('KILL') end def to_h { command: command, pid: pid } end def wait ::Process.wait pid end end end end
Version data entries
385 entries across 385 versions & 4 rubygems