Class: PryRemote::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-nav/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-nav knows this is a remote session, and not kill the server right away



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

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

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

#teardown_with_pry_navObject Also known as: teardown



26
27
28
29
# File 'lib/pry-nav/pry_remote_ext.rb', line 26

def teardown_with_pry_nav
  teardown_without_pry_nav
  PryNav.current_remote_server = nil
end