Sha256: dd358d7ae22db08415e4500e394e00791283ca5a11205e5be5490c80bca1c0bf

Contents?: true

Size: 414 Bytes

Versions: 15

Compression:

Stored size: 414 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)
      STDOUT.print(formatted_text + formatter.optional_newline) unless formatted_text.empty?
    end

  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
learn-xcpretty-0.1.12 lib/xcpretty/printer.rb
learn-xcpretty-0.1.11 lib/xcpretty/printer.rb
xcpretty-0.1.9 lib/xcpretty/printer.rb
xcpretty-0.1.8 lib/xcpretty/printer.rb
xcpretty-0.1.7 lib/xcpretty/printer.rb
xcpretty-0.1.6 lib/xcpretty/printer.rb
xcpretty-0.1.5 lib/xcpretty/printer.rb
xcpretty-0.1.4 lib/xcpretty/printer.rb
xcpretty-0.1.3 lib/xcpretty/printer.rb
xcpretty-0.1.2 lib/xcpretty/printer.rb
xcpretty-0.1.1 lib/xcpretty/printer.rb
xcpretty-0.1.0 lib/xcpretty/printer.rb
xcpretty-0.0.9 lib/xcpretty/printer.rb
xcpretty-0.0.8 lib/xcpretty/printer.rb
xcpretty-0.0.7 lib/xcpretty/printer.rb