Class: Byebug::PryCommand

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

Overview

Enter Pry 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



30
31
32
# File 'lib/byebug/commands/pry.rb', line 30

def description
  %(pry        Starts a Pry session.)
end

.namesObject



26
27
28
# File 'lib/byebug/commands/pry.rb', line 26

def names
  %w(pry)
end

Instance Method Details

#executeObject



17
18
19
20
21
22
23
# File 'lib/byebug/commands/pry.rb', line 17

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

  get_binding.pry
end

#regexpObject



13
14
15
# File 'lib/byebug/commands/pry.rb', line 13

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