Class: Byebug::UntracevarCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::UntracevarCommand
show all
- Defined in:
- lib/byebug/commands/untracevar.rb
Overview
Stop tracing a global variable.
Instance Attribute Summary
Attributes inherited from Command
#processor
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
#arguments, columnize, #context, #frame, help, #initialize, match, to_s
#camelize, #prettify
Class Method Details
.description ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/byebug/commands/untracevar.rb', line 12
def self.description
<<-EOD
untr[acevar] <variable>
#{short_description}
EOD
end
|
.regexp ⇒ Object
8
9
10
|
# File 'lib/byebug/commands/untracevar.rb', line 8
def self.regexp
/^\s* untr(?:acevar)? (?:\s+ (\S+))? \s*$/x
end
|
.short_description ⇒ Object
20
21
22
|
# File 'lib/byebug/commands/untracevar.rb', line 20
def self.short_description
'Stops tracing a global variable'
end
|
Instance Method Details
#execute ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'lib/byebug/commands/untracevar.rb', line 24
def execute
var = @match[1]
if global_variables.include?(:"#{var}")
untrace_var(:"#{var}")
puts pr('trace.messages.undo', var: var)
else
errmsg pr('trace.errors.not_global', var: var)
end
end
|