Class: Byebug::PryCommand

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

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



121
122
123
# File 'lib/byebug/commands/repl.rb', line 121

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

.namesObject



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

def names
  %w(pry)
end

Instance Method Details

#executeObject



107
108
109
110
111
112
113
114
# File 'lib/byebug/commands/repl.rb', line 107

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



103
104
105
# File 'lib/byebug/commands/repl.rb', line 103

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