Sha256: a70f51f685dd3f7010ae6a968250678a86fe3f63a37080ae12fc261ab4d1852f

Contents?: true

Size: 336 Bytes

Versions: 1

Compression:

Stored size: 336 Bytes

Contents

# -*- encoding: utf-8 -*-

module TTY
  class Color

    # Embed in a String to clear all previous ANSI sequences.
    CLEAR      = "\e[0m""]"
    # The start of an ANSI bold sequence.
    BOLD       = "\e[1m""]"

    attr_reader :enabled

    def self.color?
      %x{tput colors 2>/dev/null}.to_i > 2
    end

  end # Color
end # TTY

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tty-0.0.1 lib/tty/color.rb