Class: Debugger::WhereCommand

Inherits:
Command
  • Object
show all
Includes:
FrameFunctions
Defined in:
lib/ruby-debug/commands/frame.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FrameFunctions

#format_frame

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ruby-debug/commands/frame.rb', line 33

def help(cmd)
  if cmd == 'where'
    %{
      w[here]\tdisplay frames
    }
  else
    %{
      f[rame]\t\talias for where
    }
  end
end

.help_commandObject



29
30
31
# File 'lib/ruby-debug/commands/frame.rb', line 29

def help_command
  %w|where frame|
end

Instance Method Details

#executeObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/ruby-debug/commands/frame.rb', line 17

def execute
  @state.frames.each_with_index do |frame, idx|
    if idx == @state.frame_pos
      print "--> "
    else
      print "    "
    end
    print format_frame(frame, idx)
  end
end

#regexpObject



13
14
15
# File 'lib/ruby-debug/commands/frame.rb', line 13

def regexp
  /^\s*(?:w(?:here)?|f(?:rame)?)$/
end