Class: Byebug::ThreadListCommand

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

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, #print_subcmds, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.help(cmd) ⇒ Object



63
64
65
66
67
# File 'lib/byebug/commands/threads.rb', line 63

def help(cmd)
  %{
    th[read] l[ist]\t\t\tlist all threads
  }
end

.help_commandObject



59
60
61
# File 'lib/byebug/commands/threads.rb', line 59

def help_command
  'thread'
end

Instance Method Details

#executeObject



52
53
54
55
56
# File 'lib/byebug/commands/threads.rb', line 52

def execute
  threads = Byebug.contexts.sort_by{|c| c.thnum}.each do |c|
    display_context(c)
  end
end

#regexpObject



48
49
50
# File 'lib/byebug/commands/threads.rb', line 48

def regexp
  /^\s*th(?:read)?\s+l(?:ist)?\s*$/
end