Class: PryRemote::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-debugger/pry_remote_ext.rb

Instance Method Summary collapse

Instance Method Details

#runObject

Override the call to Pry.start to save off current Server, pass a pry_remote flag so pry-debugger knows this is a remote session, and not kill the server right away.


8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pry-debugger/pry_remote_ext.rb', line 8

def run
  if PryDebugger.current_remote_server
    raise 'Already running a pry-remote session!'
  else
    PryDebugger.current_remote_server = self
  end

  setup
  Pry.start @object, {
    :input  => client.input_proxy,
    :output => client.output,
    :pry_remote => true
  }
end

#teardownObject


25
26
27
28
29
30
31
# File 'lib/pry-debugger/pry_remote_ext.rb', line 25

def teardown
  return if @torn

  teardown_existing
  PryDebugger.current_remote_server = nil
  @torn = true
end

#teardown_existingObject

Override to reset our saved global current server session.


24
# File 'lib/pry-debugger/pry_remote_ext.rb', line 24

alias_method :teardown_existing, :teardown