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



23
24
25
# File 'lib/byebug/commands/pry.rb', line 23

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

.namesObject



19
20
21
# File 'lib/byebug/commands/pry.rb', line 19

def names
  %w(pry)
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
# File 'lib/byebug/commands/pry.rb', line 10

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

  get_binding.pry
end

#regexpObject



6
7
8
# File 'lib/byebug/commands/pry.rb', line 6

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