Sha256: 3d1c5cf0a564f388677957b04f141056213e034a6c15a7465fcadcae7b91f7fa

Contents?: true

Size: 1.08 KB

Versions: 6771

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require "pry-remote"

module PryRemote
  #
  # Overrides PryRemote::Server
  #
  class Server
    #
    # Override the call to Pry.start to save off current Server, and not
    # teardown the server right after Pry.start finishes.
    #
    def run
      raise("Already running a pry-remote session!") if
        PryByebug.current_remote_server

      PryByebug.current_remote_server = self

      setup
      Pry.start @object, input: client.input_proxy, output: client.output
    end

    #
    # Override to reset our saved global current server session.
    #
    alias teardown_without_pry_byebug teardown
    def teardown_with_pry_byebug
      return if @torn

      teardown_without_pry_byebug
      PryByebug.current_remote_server = nil
      @torn = true
    end
    alias teardown teardown_with_pry_byebug
  end
end

# Ensure cleanup when a program finishes without another break. For example,
# 'next' on the last line of a program won't hit Byebug::PryProcessor#run,
# which normally handles cleanup.
at_exit do
  PryByebug.current_remote_server&.teardown
end

Version data entries

6,771 entries across 6,767 versions & 30 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/pry-byebug-3.9.0/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/lib/pry-byebug/pry_remote_ext.rb