Class: Byebug::ThreadListCommand

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



84
85
86
87
88
# File 'lib/byebug/commands/threads.rb', line 84

def description
  %{
    th[read] l[ist]\t\t\tlist all threads
  }
end

.namesObject



80
81
82
# File 'lib/byebug/commands/threads.rb', line 80

def names
  %w(thread)
end

Instance Method Details

#executeObject



74
75
76
77
# File 'lib/byebug/commands/threads.rb', line 74

def execute
  Byebug.contexts.select { |c| Thread.list.include?(c.thread) }
                 .sort_by(&:thnum).each { |c| display_context(c) }
end

#regexpObject



70
71
72
# File 'lib/byebug/commands/threads.rb', line 70

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