module Cucumber::Term::ANSIColor

This module allows to colorize text using ANSI escape sequences.

Include the module in your class and use its methods to colorize text.

Example:

require 'cucumber/term/ansicolor'

class MyFormatter
  include Cucumber::Term::ANSIColor

  def initialize(config)
    $stdout.puts yellow("Initializing formatter")
    $stdout.puts green("Coloring is active \o/") if Cucumber::Term::ANSIColor.coloring?
    $stdout.puts grey("Feature path:") + blue(bold(config.feature_dirs))
  end
end

To see what colours and effects are available, just run this in your shell:

ruby -e "require 'rubygems'; require 'cucumber/term/ansicolor'; puts Cucumber::Term::ANSIColor.attributes"