Class: Byebug::SkipCommand
Overview
Allows the user to continue execution until the next breakpoint, as long as it is different from the current one
Class Attribute Summary collapse
Attributes inherited from Command
#processor
Class Method Summary
collapse
Instance Method Summary
collapse
#get_int, #parse_steps, #syntax_valid?
Methods inherited from Command
#arguments, columnize, #context, #frame, help, #initialize, match, to_s
#camelize, #deindent, #prettify
Class Attribute Details
.file_line ⇒ Object
17
18
19
|
# File 'lib/byebug/commands/skip.rb', line 17
def file_line
@file_line ||= 0
end
|
.file_path ⇒ Object
21
22
23
|
# File 'lib/byebug/commands/skip.rb', line 21
def file_path
@file_path ||= ""
end
|
Class Method Details
.description ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/byebug/commands/skip.rb', line 30
def self.description
<<-DESCRIPTION
sk[ip]
#{short_description}
DESCRIPTION
end
|
.regexp ⇒ Object
26
27
28
|
# File 'lib/byebug/commands/skip.rb', line 26
def self.regexp
/^\s* sk(?:ip)? \s*$/x
end
|
.short_description ⇒ Object
38
39
40
|
# File 'lib/byebug/commands/skip.rb', line 38
def self.short_description
"Runs until the next breakpoint as long as it is different from the current one"
end
|
Instance Method Details
#auto_run ⇒ Object
56
57
58
59
60
61
|
# File 'lib/byebug/commands/skip.rb', line 56
def auto_run
return false unless self.class.always_run == 2
keep_execution ? processor.proceed! : reset_attributes
true
end
|
#execute ⇒ Object
63
64
65
66
67
68
69
|
# File 'lib/byebug/commands/skip.rb', line 63
def execute
return if auto_run
initialize_attributes
processor.proceed!
Byebug.stop if Byebug.stoppable?
end
|
#initialize_attributes ⇒ Object
42
43
44
45
46
|
# File 'lib/byebug/commands/skip.rb', line 42
def initialize_attributes
self.class.always_run = 2
self.class.file_path = frame.file
self.class.file_line = frame.line
end
|
#keep_execution ⇒ Object
48
49
50
|
# File 'lib/byebug/commands/skip.rb', line 48
def keep_execution
[self.class.file_path, self.class.file_line] == [frame.file, frame.line]
end
|
#reset_attributes ⇒ Object
52
53
54
|
# File 'lib/byebug/commands/skip.rb', line 52
def reset_attributes
self.class.always_run = 0
end
|