class XCPretty::Printer
Attributes
formatter[R]
Public Class Methods
new(params)
click to toggle source
# File lib/xcpretty/printer.rb, line 9 def initialize(params) klass = params[:formatter] @formatter = klass.new(params[:unicode], params[:colorize]) end
Public Instance Methods
finish()
click to toggle source
# File lib/xcpretty/printer.rb, line 14 def finish @formatter.finish end
pretty_print(text)
click to toggle source
# File lib/xcpretty/printer.rb, line 18 def pretty_print(text) formatted_text = formatter.pretty_format(text) unless formatted_text.empty? STDOUT.print(formatted_text + formatter.optional_newline) STDOUT.flush end end