Class: Byebug::ThreadResumeCommand

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

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



162
163
164
# File 'lib/byebug/commands/threads.rb', line 162

def description
  %{th[read] resume <nnn>\t\tresume thread nnn}
end

.namesObject



158
159
160
# File 'lib/byebug/commands/threads.rb', line 158

def names
  %w(thread)
end

Instance Method Details

#executeObject



146
147
148
149
150
151
152
153
154
155
# File 'lib/byebug/commands/threads.rb', line 146

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

#regexpObject



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

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