Sha256: f6c9bb3d28ecffaacafcd430db489ea463b116bcabf4bbbb6aef9f4d60c7a4d6

Contents?: true

Size: 694 Bytes

Versions: 8

Compression:

Stored size: 694 Bytes

Contents

module Reline
  class IO
    RESET_COLOR = "\e[0m"

    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

    def dumb?
      false
    end

    def win?
      false
    end

    def reset_color_sequence
      self.class::RESET_COLOR
    end
  end
end

require 'reline/io/dumb'

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
reline-0.5.11 lib/reline/io.rb
brakeman-6.2.2 bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/io.rb
brakeman-6.2.2.rc1 bundle/ruby/3.3.0/gems/reline-0.5.10/lib/reline/io.rb
reline-0.5.10 lib/reline/io.rb
brakeman-6.2.1 bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/io.rb
brakeman-6.2.0 bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/io.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/reline-0.5.9/lib/reline/io.rb
reline-0.5.9 lib/reline/io.rb