Sha256: d8ffde48079975035c8041de95b0ab4f2213a7b17752b342154da3df40021f9b

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

module Byebug::DAP
  # A debug session 'connection' using STDIN and STDOUT.
  # @api private
  class STDIO
    extend Forwardable

    def initialize
      @in = STDIN.dup
      @out = STDOUT.dup
      @in.sync = true
      @out.sync = true
    end

    def close; @in.close; @out.close; end
    def flush; @in.flush; @out.flush; end
    def fsync; @in.fsync; @out.fsync; end
    def closed?; @in.closed? || @out.closed?; end

    def_delegators :@in, :close_read, :bytes, :chars, :codepoints, :each, :each_byte, :each_char, :each_codepoint, :each_line, :getbyte, :getc, :gets, :lines, :pread, :print, :printf, :read, :read_nonblock, :readbyte, :readchar, :readline, :readlines, :readpartial, :sysread, :ungetbyte, :ungetc
    def_delegators :@out, :<<, :close_write, :putc, :puts, :pwrite, :syswrite, :write, :write_nonblock
    public :<<, :bytes, :chars, :close_read, :close_write, :codepoints, :each, :each_byte, :each_char, :each_codepoint, :each_line, :getbyte, :getc, :gets, :lines, :pread, :print, :printf, :putc, :puts, :pwrite, :read, :read_nonblock, :readbyte, :readchar, :readline, :readlines, :readpartial, :sysread, :syswrite, :ungetbyte, :ungetc, :write, :write_nonblock
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
byebug-dap-0.1.4 lib/byebug/dap/helpers/stdio.rb