Sha256: 3fe0e9e69d555ca545d265375d14b579f5fc2e3f9879a4eb3ffc6b184a4ea929
Contents?: true
Size: 930 Bytes
Versions: 13
Compression:
Stored size: 930 Bytes
Contents
require 'byebug/command' require 'byebug/helpers/path' require 'shellwords' module Byebug # # Restart debugged program from within byebug. # class RestartCommand < Command include Helpers::PathHelper self.allow_in_control = true self.allow_in_post_mortem = true def self.regexp /^\s* restart (?:\s+(?<args>.+))? \s*$/x end def self.description <<-EOD restart [args] #{short_description} This is a re-exec - all byebug state is lost. If command arguments are passed those are used. EOD end def self.short_description 'Restarts the debugged program' end def execute argv = [$PROGRAM_NAME] argv.unshift(bin_file) if Byebug.mode == :standalone argv += (@match[:args] ? @match[:args].shellsplit : $ARGV.compact) puts pr('restart.success', cmd: argv.shelljoin) exec(*argv) end end end
Version data entries
13 entries across 13 versions & 1 rubygems