Sha256: c49f15f82a8bf8ad2c4718baeba3135f7921fb8a484fe2bbcaded91bc12272f4

Contents?: true

Size: 481 Bytes

Versions: 5

Compression:

Stored size: 481 Bytes

Contents

begin
  require 'facets/ansicode'
rescue LoadError
  begin
    require 'rubygems'
    require 'facets/ansicode'
  rescue LoadError
  end
end

module Turn
  
  module Colorize

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

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

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
TwP-turn-0.5.1 lib/turn/colorize.rb
TwP-turn-0.6.0 lib/turn/colorize.rb
turn-0.6.0 lib/turn/colorize.rb
turn-0.4.0 lib/turn/colorize.rb
turn-0.5.1 lib/turn/colorize.rb