Class: Reline::IO

Inherits:
Object
  • Object
show all
Defined in:
lib/reline/io.rb

Direct Known Subclasses

ANSI, Dumb, Windows

Constant Summary collapse

RESET_COLOR =
"\e[0m"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.decide_io_gateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/reline/io.rb', line 6

def self.decide_io_gate
  if ENV['TERM'] == 'dumb'
    Reline::Dumb.new
  else
    require 'reline/io/ansi'

    case RbConfig::CONFIG['host_os']
    when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
      require 'reline/io/windows'
      io = Reline::Windows.new
      if io.msys_tty?
        Reline::ANSI.new
      else
        io
      end
    else
      Reline::ANSI.new
    end
  end
end

Instance Method Details

#dumb?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/reline/io.rb', line 27

def dumb?
  false
end

#reset_color_sequenceObject



35
36
37
# File 'lib/reline/io.rb', line 35

def reset_color_sequence
  self.class::RESET_COLOR
end

#win?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/reline/io.rb', line 31

def win?
  false
end