Sha256: a4dc84e472924d81f3294fe82a47090e38ce317bbe443a1e3edb59c6f2387656

Contents?: true

Size: 502 Bytes

Versions: 9

Compression:

Stored size: 502 Bytes

Contents

require "xcpretty/ansi"

module XCPretty

  class Printer

    attr_reader :formatter

    def initialize(params)
      klass = params[:formatter]
      @formatter = klass.new(params[:unicode], params[:colorize])
    end

    def finish
      @formatter.finish
    end

    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

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
xcpretty-0.4.0 lib/xcpretty/printer.rb
xcpretty-security-patched-0.3.2 lib/xcpretty/printer.rb
xcpretty-security-patched-0.3.0 lib/xcpretty/printer.rb
xcpretty-0.3.0 lib/xcpretty/printer.rb
xcpretty-0.2.8 lib/xcpretty/printer.rb
xcpretty-0.2.7 lib/xcpretty/printer.rb
xcpretty-0.2.6 lib/xcpretty/printer.rb
xcpretty-0.2.4 lib/xcpretty/printer.rb
xcpretty-0.2.3 lib/xcpretty/printer.rb