Class: Byebug::RestartCommand
- Includes:
- Helpers::PathHelper
- Defined in:
- lib/byebug/commands/restart.rb
Overview
Restart debugged program from within byebug.
Instance Attribute Summary
Attributes inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Helpers::PathHelper
#all_files, #bin_file, #ext_files, #gem_files, #lib_files, #root_path, #test_files
Methods inherited from Command
#arguments, columnize, #context, #frame, help, #initialize, match, to_s
Methods included from Helpers::StringHelper
Constructor Details
This class inherits a constructor from Byebug::Command
Class Method Details
.description ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/byebug/commands/restart.rb', line 19 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 |
.regexp ⇒ Object
15 16 17 |
# File 'lib/byebug/commands/restart.rb', line 15 def self.regexp /^\s* restart (?:\s+(?<args>.+))? \s*$/x end |
.short_description ⇒ Object
30 31 32 |
# File 'lib/byebug/commands/restart.rb', line 30 def self.short_description 'Restarts the debugged program' end |
Instance Method Details
#execute ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/byebug/commands/restart.rb', line 34 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) Kernel.exec(*argv) end |