Sha256: 82411dec040cee986f7a88f1b36d779202f314314c30baf87447f6d4c01e3d83

Contents?: true

Size: 454 Bytes

Versions: 17

Compression:

Stored size: 454 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 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

17 entries across 17 versions & 2 rubygems

Version Path
xcpretty-bb-0.1.12.bb14 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb13 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb12 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb11 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb10 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb9 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb8 lib/xcpretty/printer.rb
xcpretty-0.2.2 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb7 lib/xcpretty/printer.rb
xcpretty-0.2.1 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb6 lib/xcpretty/printer.rb
xcpretty-0.2.0 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb5 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb4 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb3 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb2 lib/xcpretty/printer.rb
xcpretty-bb-0.1.12.bb1 lib/xcpretty/printer.rb