Class: Byebug::PryCommand

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

Overview

Implements byebug’s “pry” command

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

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, method_missing, options, 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



135
136
137
# File 'lib/byebug/commands/repl.rb', line 135

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

.namesObject



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

def names
  %w(pry)
end

Instance Method Details

#executeObject



121
122
123
124
125
126
127
128
# File 'lib/byebug/commands/repl.rb', line 121

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



117
118
119
# File 'lib/byebug/commands/repl.rb', line 117

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