Class: Byebug::DeleteCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::DeleteCommand
show all
- Defined in:
- lib/byebug/commands/breakpoints.rb
Overview
Implements byebug “delete” command.
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
128
129
130
131
132
133
|
# File 'lib/byebug/commands/breakpoints.rb', line 128
def description
%{del[ete][ nnn...]
Without and argument, deletes all breakpoints. With integer arguments,
it deletes specific breakpoints.}
end
|
.names ⇒ Object
124
125
126
|
# File 'lib/byebug/commands/breakpoints.rb', line 124
def names
%w(delete)
end
|
Instance Method Details
#execute ⇒ Object
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# File 'lib/byebug/commands/breakpoints.rb', line 108
def execute
return errmsg "We are not in a state we can delete breakpoints.\n" unless
@state.context
if not @match[1]
Byebug.breakpoints.clear if confirm("Delete all breakpoints? (y or n) ")
else
@match[1].split(/[ \t]+/).each do |pos|
return unless pos = get_int(pos, "Delete", 1)
errmsg "No breakpoint number %d\n", pos unless
Byebug.remove_breakpoint(pos)
end
end
end
|
#regexp ⇒ Object
104
105
106
|
# File 'lib/byebug/commands/breakpoints.rb', line 104
def regexp
/^\s* del(?:ete)? (?:\s+(.*))?$/x
end
|