Sha256: 9b0cb049b15911cd11254b56a9515e818aaa688b6da4cf6a12662f2a0e9e0152
Contents?: true
Size: 523 Bytes
Versions: 30
Compression:
Stored size: 523 Bytes
Contents
require 'pp' require 'stringio' module Lumberjack class Formatter # Format an object with it's pretty print method. class PrettyPrintFormatter attr_accessor :width # Create a new formatter. The maximum width of the message can be specified with the width # parameter (defaults to 79 characters). def initialize(width = 79) @width = width end def call(obj) s = StringIO.new PP.pp(obj, s) s.string.chomp end end end end
Version data entries
30 entries across 28 versions & 9 rubygems