Sha256: c8c8b15f247576131d76fd51643ce04ed5fecda3573905b251cfc7966d4aec85

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

require 'byebug/history'

module Byebug
  #
  # Interface class for remote use of byebug.
  #
  class RemoteInterface < Interface
    def initialize(socket)
      super()
      @socket = socket
    end

    def close
      @socket.close
    rescue IOError
    end

    def confirm(prompt)
      send_command "CONFIRM #{prompt}"
    end

    def read_command(prompt)
      send_command "PROMPT #{prompt}"
    end

    def puts(message)
      @socket.puts(message)
    end

    private

    def send_command(msg)
      @socket.puts msg
      result = @socket.gets
      fail IOError unless result
      result.chomp
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
byebug-3.5.1 lib/byebug/interfaces/remote_interface.rb
byebug-3.5.0 lib/byebug/interfaces/remote_interface.rb