Class: Byebug::PryCommand

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

Overview

Implements byebug’s “pry” command

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

command_exists?, commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



132
133
134
# File 'lib/byebug/commands/repl.rb', line 132

def description
  %{pry\tstarts a Pry session.}
end

.namesObject



128
129
130
# File 'lib/byebug/commands/repl.rb', line 128

def names
  %w(pry)
end

Instance Method Details

#executeObject



118
119
120
121
122
123
124
125
# File 'lib/byebug/commands/repl.rb', line 118

def execute
  unless @state.interface.kind_of?(LocalInterface)
    print "Command is available only in local mode.\n"
    throw :debug_error
  end

  get_binding.pry
end

#regexpObject



114
115
116
# File 'lib/byebug/commands/repl.rb', line 114

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