Methods

Class/Module Index [+]

Quicksearch

Nanoc::CLI::ANSIStringColorizer

A simple ANSI colorizer for strings. When given a string and a list of attributes, it returns a colorized string.

Constants

MAPPING

TODO complete mapping

Public Class Methods

c(s, *as) click to toggle source

@param [String] s The string to colorize

@param [Array] as An array of attributes from `MAPPING` to colorize the

string with

@return [String] A string colorized using the given attributes

# File lib/nanoc/cli/ansi_string_colorizer.rb, line 23
def self.c(s, *as)
  as.map { |a| MAPPING[a] }.join('') + s + "\e[0m"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.