# File irb/color_printer.rb, line 23 def pp(obj) if obj.is_a?(String) # Avoid calling Ruby 2.4+ String#pretty_print that splits a string by "\n" text(obj.inspect) else super end end
# File irb/color_printer.rb, line 32 def text(str, width = nil) unless str.is_a?(String) str = str.inspect end width ||= str.length case str when /\A#</, '=', '>' super(Color.colorize(str, [:GREEN]), width) else super(Color.colorize_code(str, ignore_error: true), width) end end