Class: Byebug::IrbCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/irb.rb

Overview

Enter IRB from byebug’s prompt

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



25
26
27
# File 'lib/byebug/commands/irb.rb', line 25

def description
  %{irb        Starts an Interactive Ruby (IRB) session.}
end

.namesObject



21
22
23
# File 'lib/byebug/commands/irb.rb', line 21

def names
  %w(irb)
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
# File 'lib/byebug/commands/irb.rb', line 12

def execute
  unless @state.interface.is_a?(LocalInterface)
    return errmsg('Command is available only in local mode.')
  end

  IRB.start(__FILE__)
end

#regexpObject



8
9
10
# File 'lib/byebug/commands/irb.rb', line 8

def regexp
  /^\s* irb \s*$/x
end