Sha256: cdf6a1084c3512a7dfc15744b1fe7b123bf8df59b14eef25328a224e0c4cedad

Contents?: true

Size: 663 Bytes

Versions: 6

Compression:

Stored size: 663 Bytes

Contents

module Byebug
  #
  # Interface class for standard byebug use.
  #
  class LocalInterface < Interface
    EOF_ALIAS = 'continue'

    def initialize
      super()
      @input = STDIN
      @output = STDOUT
      @error = STDERR
    end

    #
    # Reads a single line of input using Readline. If Ctrl-C is pressed in the
    # middle of input, the line is reset to only the prompt and we ask for input
    # again. If Ctrl-D is pressed, it returns "continue".
    #
    # @param prompt Prompt to be displayed.
    #
    def readline(prompt)
      Readline.readline(prompt, false) || EOF_ALIAS
    rescue Interrupt
      puts('^C')
      retry
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
byebug-8.2.1 lib/byebug/interfaces/local_interface.rb
byebug-8.2.0 lib/byebug/interfaces/local_interface.rb
byebug-8.1.0 lib/byebug/interfaces/local_interface.rb
byebug-8.0.1 lib/byebug/interfaces/local_interface.rb
byebug-8.0.0 lib/byebug/interfaces/local_interface.rb
byebug-7.0.0 lib/byebug/interfaces/local_interface.rb