class Byebug::Command
Parent class of all byebug commands.
Subclass it and name the subclass ending with the word Command to implement your own custom command.
@example
class MyCustomCommand < Command
def self.regexp /custom_regexp/ end def self.description 'Custom long desc' end def.short_description 'Custom short desc' end def execute # My command's implementation end
end
Attributes
allow_in_control[RW]
Special methods to allow command filtering in processors
allow_in_post_mortem[RW]
Special methods to allow command filtering in processors
always_run[W]
processor[R]
Public Class Methods
new(processor, input = self.class.to_s)
click to toggle source
# File lib/byebug/command.rb, line 36 def initialize(processor, input = self.class.to_s) @processor = processor @match = match(input) end
Public Instance Methods
always_run()
click to toggle source
# File lib/byebug/command.rb, line 71 def always_run @always_run ||= 0 end
arguments()
click to toggle source
# File lib/byebug/command.rb, line 49 def arguments @match[0].split(' ').drop(1).join(' ') end
columnize(width)
click to toggle source
# File lib/byebug/command.rb, line 86 def columnize(width) format(" %-#{width}s -- %s\n", to_s, short_description) end
context()
click to toggle source
# File lib/byebug/command.rb, line 41 def context @context ||= processor.context end
frame()
click to toggle source
# File lib/byebug/command.rb, line 45 def frame @frame ||= context.frame end
help()
click to toggle source
Default help text for a command.
# File lib/byebug/command.rb, line 93 def help prettify(description) end
match(input)
click to toggle source
Command's regexp match against an input
# File lib/byebug/command.rb, line 100 def match(input) regexp.match(input) end
to_s()
click to toggle source
Name of the command, as executed by the user.
# File lib/byebug/command.rb, line 78 def to_s name .split('::') .map { |n| n.gsub(/Command$/, '').downcase if n =~ /Command$/ } .compact .join(' ') end