| Module | Coveralls::Output |
| In: |
lib/coveralls/output.rb
|
Public: Methods for formatting strings with Term::ANSIColor. Does not utilize monkey-patching and should play nicely when included with other libraries.
All methods are module methods and should be called on the Coveralls::Output module.
Examples
Coveralls::Output.format("Hello World", :color => "cyan")
# => "\e[36mHello World\e[0m"
Coveralls::Output.print("Hello World")
# Hello World => nil
Coveralls::Output.puts("Hello World", :color => "underline")
# Hello World
# => nil
To silence output completely:
Coveralls::Output.silent = true
or set this environment variable:
COVERALLS_SILENT
To disable color completely:
Coveralls::Output.no_color = true
| no_color | [RW] | |
| output | [W] | |
| silent | [RW] |
Public: Formats the given string with the specified color through Term::ANSIColor
string - the text to be formatted options - The hash of options used for formatting the text:
:color - The color to be passed as a method to
Term::ANSIColor
Examples
Coveralls::Output.format("Hello World!", :color => "cyan")
# => "\e[36mHello World\e[0m"
Returns the formatted string.
Public: Passes .format to Kernel#print
string - the text to be formatted options - The hash of options used for formatting the text:
:color - The color to be passed as a method to
Term::ANSIColor
Example
Coveralls::Output.print("Hello World!", :color => "underline")
Returns nil.
Public: Passes .format to Kernel#puts
string - the text to be formatted options - The hash of options used for formatting the text:
:color - The color to be passed as a method to
Term::ANSIColor
Example
Coveralls::Output.puts("Hello World", :color => "cyan")
Returns nil.