module Webgen::CLI::Utils

Provides methods for CLI classes for formatting text in a consistent manner.

Constants

DEFAULT_WIDTH

Attributes

use_colors[RW]

Public Class Methods

format(content, width = DEFAULT_WIDTH, indent = 0, first_line_indented = false)

Return an array of lines which represents the text in content formatted so that no line is longer than width characters.

The indent parameter specifies the amount of spaces prepended to each line. If first_line_indented is true, then the first line is indented.

method_missing(id, text = nil)

Used for dynamically formatting the text (setting color, bold face, …).

The id (method name) can be one of the following: bold, light, green, yellow, red, blue, reset.