Class: Byebug::ThreadStopCommand

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

Overview

Stop 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



142
143
144
# File 'lib/byebug/commands/threads.rb', line 142

def description
  %(th[read] stop <n>        Stops thread <n>.)
end

.namesObject



138
139
140
# File 'lib/byebug/commands/threads.rb', line 138

def names
  %w(thread)
end

Instance Method Details

#executeObject



129
130
131
132
133
134
135
# File 'lib/byebug/commands/threads.rb', line 129

def execute
  c = parse_thread_num_for_cmd('thread stop', @match[1])
  return unless c

  c.suspend
  display_context(c)
end

#regexpObject



125
126
127
# File 'lib/byebug/commands/threads.rb', line 125

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