Methods for printing output of Cuby programs. Supports different verbosity levels.
The module is automatically mixed into Object.
Five verbosity levels are introduced:
Global variable storing the verbosity level is defined: $verbosity
Default level is V_VERBOSE. If the Cuby.config object exists, the program attempts to read verbosity from Cuby.config['verbosity'], using eval to read both numbers and constants.
print_cuby_logo(text='',verbosity_limit=V_VERBOSE)
Prints Cuby logo in ascii art (when $verbosity > verbosity_limit)
print_cuby_logo('text') _______ /\______\ / / / / / Cuby / text \/______/
puts_hash(strings = {})
Prints string indexed by current verbosity level
$verbosity = V_BRIEF puts_hash(V_BRIEF => "Yes!", V_VERBOSE => "blah blah blah...") Yes!
puts_hash_or_lower(strings = {})
Prints string indexed by current verbosity level or at closest lower level
$verbosity = V_BRIEF puts_hash_or_lower(V_MINIMAL => "!", V_VERBOSE => "blah blah blah...") !
Collection of methods hat print to output only when $verbosity is equal or higher than desired.
Collection of methods hat print to output only when $verbosity is equal than desired.