Module NyanCat::Common
In: lib/nyan_cat_formatter/common.rb

Methods

Constants

ESC = "\e["
NND = "#{ESC}0m"
PASS = '='
PASS_ARY = ['-', '_']
FAIL = '*'
ERROR = '!'
PENDING = '+'
VT100_CODES = { :black => 30, :red => 31, :green => 32, :yellow => 33, :blue => 34, :magenta => 35, :cyan => 36, :white => 37, :bold => 1, }
VT100_CODE_VALUES = VT100_CODES.invert

Public Class methods

Public Instance methods

Ascii version of Nyan cat. Two cats in the array allow Nyan to animate running.

@param o [String] Nyan‘s eye @return [Array] Nyan cats

Returns the cat length

@returns [Fixnum]

Calculates the colors of the rainbow

@return [Array]

Calculates the current flight length

@return [Fixnum]

Displays the current progress in all Nyan Cat glory

@return nothing

Determines how we end the trail line. If complete, return a newline etc.

@return [String]

 Times a mark has to be repeated

Determines if the any specs failed or are in pending state

@returns [Boolean] true if failed or pending; false otherwise

Determines if the specs have completed

@returns [Boolean] true if finished; false otherwise

Converts a float of seconds into a minutes/seconds string

@return [String]

Determines how to color the example. If pass, it is rainbowified, otherwise we assign red if failed or yellow if an error occurred.

@return [String]

Determine which Ascii Nyan Cat to display. If tests are complete, Nyan Cat goes to sleep. If there are failing or pending examples, Nyan Cat is concerned.

@return [String] Nyan Cat

Creates a rainbow trail

@return [String] the sprintf format of the Nyan cat

Gets the padding for the current example count

@return [Fixnum]

Colorizes the string with raindow colors of the rainbow

@params string [String] @return [String]

Creates a data store of pass, failed, and pending example results We have to pad the results here because sprintf can‘t properly pad color

@return [Array]

A Unix trick using stty to get the console columns

@return [Fixnum]

Increments the example count and displays the current progress

@returns nothing

[Validate]