Class: Byebug::IrbCommand
Overview
Implements byebug’s “irb” 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
87
88
89
90
91
92
93
|
# File 'lib/byebug/commands/repl.rb', line 87
def description
%{irb\tstarts an Interactive Ruby (IRB) session.
IRB is extended with methods "cont", "n" and "step" which run the
corresponding byebug commands. In contrast to the real byebug commands
these commands don't allow arguments.}
end
|
.names ⇒ Object
83
84
85
|
# File 'lib/byebug/commands/repl.rb', line 83
def names
%w(irb)
end
|
Instance Method Details
#execute ⇒ Object
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/byebug/commands/repl.rb', line 58
def execute
unless @state.interface.kind_of?(LocalInterface)
print "Command is available only in local mode.\n"
throw :debug_error
end
cont = IRB.start_session(get_binding)
case cont
when :cont
@state.proceed
when :step
force = Setting[:forcestep]
@state.context.step_into 1, force
@state.proceed
when :next
force = Setting[:forcestep]
@state.context.step_over 1, @state.frame_pos, force
@state.proceed
else
print @state.location
@state.previous_line = nil
end
end
|
#regexp ⇒ Object
54
55
56
|
# File 'lib/byebug/commands/repl.rb', line 54
def regexp
/^\s* irb \s*$/x
end
|