Sha256: 50beaf5e517b4c6efddd6df61ab7ae81da313b06db71abca11d9c1437a6ec79a

Contents?: true

Size: 588 Bytes

Versions: 4

Compression:

Stored size: 588 Bytes

Contents

require 'byebug/history'

module Byebug
  #
  # Interface class for standard byebug use.
  #
  class LocalInterface < Interface
    attr_reader :history

    def initialize
      super
      History.load
    end

    def read_command(prompt)
      readline(prompt, true)
    end

    def confirm(prompt)
      readline(prompt, false)
    end

    def puts(*args)
      STDOUT.puts(*args)
    end

    def close
      History.save
    end

    private

    def readline(prompt, hist)
      Readline.readline(prompt, hist)
    rescue Interrupt
      puts '^C'
      retry
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
byebug-3.4.2 lib/byebug/interfaces/local_interface.rb
byebug-3.4.1 lib/byebug/interfaces/local_interface.rb
byebug-3.4.0 lib/byebug/interfaces/local_interface.rb
byebug-3.3.0 lib/byebug/interfaces/local_interface.rb