Class: Byebug::ThreadResumeCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/threads.rb

Overview

Resume execution of a thread.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



172
173
174
# File 'lib/byebug/commands/threads.rb', line 172

def description
  %(th[read] resume <n>        Resumes thread <n>.)
end

.namesObject



168
169
170
# File 'lib/byebug/commands/threads.rb', line 168

def names
  %w(thread)
end

Instance Method Details

#executeObject



159
160
161
162
163
164
165
# File 'lib/byebug/commands/threads.rb', line 159

def execute
  c = parse_thread_num_for_cmd('thread resume', @match[1])
  return unless c
  return errmsg('Already running') unless c.suspended?
  c.resume
  display_context(c)
end

#regexpObject



155
156
157
# File 'lib/byebug/commands/threads.rb', line 155

def regexp
  /^\s* th(?:read)? \s+ resume \s* (\S*) \s*$/x
end