Sha256: 7ca4bacf7550e161feb5478f3039cc226acc235da676d16e661c42d3de9e5648

Contents?: true

Size: 570 Bytes

Versions: 3

Compression:

Stored size: 570 Bytes

Contents

# frozen_string_literal: true

module Helium
  class Console
    class ColorPrinter < Pry::ColorPrinter
      def self.pp(obj, output = $DEFAULT_OUTPUT, max_width = 79)
        queue = ColorPrinter.new(output, max_width, "\n")
        queue.guard_inspect_key { queue.pp(obj) }
        queue.flush
        output << "\n"
      end

      def pp(object)
        formatted = Helium::Console.format(object)
        formatted = "\n#{formatted}" if formatted.lines.count > 1
        output << formatted
      end

      ::Pry.config.print = method(:default)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
helium-console-0.1.10 lib/helium/console/printer.rb
helium-console-0.1.9 lib/helium/console/printer.rb
helium-console-0.1.8 lib/helium/console/printer.rb