class Bundler::Thor::LineEditor::Basic - bundler-1.9.9 Documentation

# class Bundler::Thor::LineEditor::Basic

### Attributes

options[R]
prompt[R]

### Public Class Methods

available?() click to toggle source

    # File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 6
    def self.available?
      true
    end

new(prompt, options) click to toggle source

    # File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 10
    def initialize(prompt, options)
      @prompt = prompt
      @options = options
    end

### Public Instance Methods

readline() click to toggle source

    # File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 15
    def readline
      $stdout.print(prompt)
      get_input
    end

### Private Instance Methods

echo?() click to toggle source

    # File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 30
    def echo?
      options.fetch(:echo, true)
    end

get_input() click to toggle source

    # File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 22
    def get_input
      if echo?
        $stdin.gets
      else
        $stdin.noecho(&:gets)
      end
    end