Sha256: e187b1ff247cee202012fd98364794d13c74b52127d43731be2205fd02983411
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
require 'pry' unless defined? Pry require 'pry-remote' module PryRemote class Server # 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 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 # Override to reset our saved global current server session. alias teardown_without_pry_nav teardown def teardown_with_pry_nav teardown_without_pry_nav PryNav.current_remote_server = nil end alias teardown teardown_with_pry_nav end end # Ensure cleanup when a program finishes without another break. For example, # 'next' on the last line of a program never hits the tracer proc, and thus # PryNav::Tracer#run doesn't have a chance to cleanup. at_exit do set_trace_func nil PryNav.current_remote_server.teardown if PryNav.current_remote_server end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
pryx-0.11.0 | lib/pry-nav/pry_remote_ext.rb |
pry-nav-1.0.0 | lib/pry-nav/pry_remote_ext.rb |