class IRB::ColorPrinter
def text(str, width = nil)
def text(str, width = nil) unless str.is_a?(String) str = str.inspect end width ||= str.length case str when '' when ',', '=>', '[', ']', '{', '}', '..', '...', /\A@\w+\z/ super(str, width) when /\A#</, '=', '>' super(Color.colorize(str, [:GREEN]), width) else super(Color.colorize_code(str, ignore_error: true), width) end end