Sha256: 9e32239b2604d6df411008008e559b48b696898333910e00d5e87c081192bcfa

Contents?: true

Size: 477 Bytes

Versions: 4

Compression:

Stored size: 477 Bytes

Contents

begin
  require 'ansi/code'
rescue LoadError
  begin
    require 'rubygems'
    require 'ansi/code'
  rescue LoadError
  end
end

module Turn

  module Colorize

    COLORIZE = defined?(::ANSI::Code) && ENV.has_key?('TERM')

    if COLORIZE
      PASS  = ::ANSI::Code.green('PASS')
      FAIL  = ::ANSI::Code.red('FAIL')
      ERROR = ::ANSI::Code.white(::ANSI::Code.on_red('ERROR'))
    else
      PASS  = "PASS"
      FAIL  = "FAIL"
      ERROR = "ERROR"
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
turn-0.7.0 lib/turn/colorize.rb
turn-0.6.3 lib/turn/colorize.rb
turn-0.6.2 lib/turn/colorize.rb
turn-0.6.1 lib/turn/colorize.rb