Module: Clin::LineReader

Defined in:
lib/clin/line_reader.rb

Overview

Handle to delegate the scan method to the right module. It will use Readline unless the disabled using Clin.use_readline = false

Defined Under Namespace

Classes: Basic, Readline

Class Method Summary collapse

Class Method Details

.readersObject



10
11
12
# File 'lib/clin/line_reader.rb', line 10

def self.readers
  @readers ||= [Clin::LineReader::Readline, Clin::LineReader::Basic]
end

.scan(shell, statement, options = {}) ⇒ Object



6
7
8
# File 'lib/clin/line_reader.rb', line 6

def self.scan(shell, statement, options = {})
  readers.detect(&:available?).new(shell, statement, options).readline
end