Class: Watson::Formatters::NoColorFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- Watson::Formatters::NoColorFormatter
- Defined in:
- lib/watson/formatters/nocolor_formatter.rb
Constant Summary
Constants included from Watson
BLUE, BOLD, CYAN, GRAY, GREEN, MAGENTA, RED, RESET, UNDERLINE, VERSION, WHITE, YELLOW
Instance Method Summary collapse
-
#initialize(config) ⇒ NoColorFormatter
constructor
A new instance of NoColorFormatter.
-
#print_header ⇒ Object
Standard header print for class call (uses member cprint).
-
#print_status(msg) ⇒ Object
Status printer for member call (uses member cprint) Print status block in standard format.
- #run(structure) ⇒ Object
Methods included from Watson
Constructor Details
#initialize(config) ⇒ NoColorFormatter
3 4 5 6 7 |
# File 'lib/watson/formatters/nocolor_formatter.rb', line 3 def initialize(config) super @output = STDOUT end |
Instance Method Details
#print_header ⇒ Object
Standard header print for class call (uses member cprint)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/watson/formatters/nocolor_formatter.rb', line 29 def print_header # Identify method entry debug_print "#{ self } : #{ __method__ }\n" # Header cprint <<-MESSAGE.gsub(/^(\s+)/, '') ------------------------------ watson - inline issue manager\n Run in: #{Dir.pwd} Run @ #{Time.now.asctime} ------------------------------\n MESSAGE end |
#print_status(msg) ⇒ Object
Status printer for member call (uses member cprint) Print status block in standard format
47 48 49 |
# File 'lib/watson/formatters/nocolor_formatter.rb', line 47 def print_status(msg) cprint "[ #{msg} ]" end |
#run(structure) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/watson/formatters/nocolor_formatter.rb', line 9 def run(structure) debug_print "#{self} : #{__method__}\n" output_result do # Check Config to see if we have access to less for printing # If so, open our temp file as the output to write to # Else, just print out to STDOUT # Print header for output debug_print "Printing Header\n" print_header # Print out structure that was passed to this Printer debug_print "Starting structure printing\n" print_structure(structure) end end |