module Lucid::Formatter::ANSIColor

Defines aliases for colored output. You don't invoke any methods from this module directly, but you can change the output colors by defining a LUCID_COLORS variable in your shell, very much like how you can tweak the familiar POSIX command ls with $LS_COLORS.

The colors that you can change are:

For instance, if your shell has a black background and a green font (like the “Homebrew” settings for OS X' Terminal.app), you may want to override passed steps to be white instead of green.

Although not listed, you can also use grey.

Examples: (On Windows, use SET instead of export.)

export LUCID_COLORS="passed=white"
export LUCID_COLORS="passed=white,bold:passed_param=white,bold,underline"

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

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

Constants

ALIASES

Public Class Methods

define_real_grey() click to toggle source
# File lib/lucid/formatter/ansicolor.rb, line 139
def self.define_real_grey
  def grey(string)
    if ::Lucid::Term::ANSIColor.coloring?
      "\e[90m#{string}\e[0m"
    else
      string
    end
  end
end

Public Instance Methods

green_lucid(n) click to toggle source
# File lib/lucid/formatter/ansicolor.rb, line 155
def green_lucid(n)
  blink(green(lucid(n)))
end
grey(string) click to toggle source
# File lib/lucid/formatter/ansicolor.rb, line 140
def grey(string)
  if ::Lucid::Term::ANSIColor.coloring?
    "\e[90m#{string}\e[0m"
  else
    string
  end
end
lucid(n) click to toggle source
# File lib/lucid/formatter/ansicolor.rb, line 151
def lucid(n)
  ('(::) ' * n).strip
end
red_lucid(n) click to toggle source
# File lib/lucid/formatter/ansicolor.rb, line 159
def red_lucid(n)
  blink(red(lucid(n)))
end
yellow_lucid(n) click to toggle source
# File lib/lucid/formatter/ansicolor.rb, line 163
def yellow_lucid(n)
  blink(yellow(lucid(n)))
end