Cucumberex.Formatter.ANSI (cucumberex v0.2.1)

Copy Markdown View Source

ANSI color helpers. Each function wraps s in an ANSI color then a reset.

Summary

Functions

Wrap s in blue ANSI codes.

Wrap s in bright (bold) ANSI codes.

Colorize s by result status. Unknown statuses return s unchanged.

Wrap s in cyan ANSI codes.

Wrap s in green ANSI codes.

Wrap s in light-black (grey) ANSI codes.

Wrap s in red ANSI codes.

Wrap s in yellow ANSI codes.

Functions

blue(s)

Wrap s in blue ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.blue("x")
IO.ANSI.blue() <> "x" <> IO.ANSI.reset()

bold(s)

Wrap s in bright (bold) ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.bold("x")
IO.ANSI.bright() <> "x" <> IO.ANSI.reset()

colorize(s, arg2)

Colorize s by result status. Unknown statuses return s unchanged.

Examples

iex> Cucumberex.Formatter.ANSI.colorize("ok", :passed) == Cucumberex.Formatter.ANSI.green("ok")
true

iex> Cucumberex.Formatter.ANSI.colorize("x", :unknown_status)
"x"

cyan(s)

Wrap s in cyan ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.cyan("x")
IO.ANSI.cyan() <> "x" <> IO.ANSI.reset()

green(s)

Wrap s in green ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.green("x")
IO.ANSI.green() <> "x" <> IO.ANSI.reset()

grey(s)

Wrap s in light-black (grey) ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.grey("x")
IO.ANSI.light_black() <> "x" <> IO.ANSI.reset()

red(s)

Wrap s in red ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.red("x")
IO.ANSI.red() <> "x" <> IO.ANSI.reset()

yellow(s)

Wrap s in yellow ANSI codes.

Examples

iex> Cucumberex.Formatter.ANSI.yellow("x")
IO.ANSI.yellow() <> "x" <> IO.ANSI.reset()