Sha256: cd88a3081a76461a67e224806c6b863abea765862ac7e36dbca5b3d7e5f2e766
Contents?: true
Size: 973 Bytes
Versions: 22
Compression:
Stored size: 973 Bytes
Contents
module Debugger # Implements debugger "kill" command class KillCommand < Command self.allow_in_control = true def regexp / ^\s* (?:kill) \s* (?:\s+(\S+))?\s* $ /ix end def execute puts @match[1] if @match[1] signame = @match[1] unless Signal.list.member?(signame) errmsg("signal name #{signame} is not a signal I know about\n") return false end if 'KILL' == signame @state.interface.finalize end else if not confirm("Really kill? (y/n) ") return else signame = 'KILL' end end Process.kill(signame, Process.pid) end class << self def help_command %w[kill] end def help(cmd) %{ kill [SIGNAL] Send [signal] to Process.pid Equivalent of Process.kill(Process.pid) } end end end end
Version data entries
22 entries across 22 versions & 3 rubygems