Methods
Constants
METHOD_INSPECT | = | Object.instance_method(:inspect) |
METHOD_RESPOND_TO | = | Object.instance_method(:respond_to?) |
Class Public methods
pp(obj, out = $>, width = screen_width) Link
Instance Public methods
pp(obj) Link
text(str, width = nil) Link
# File ruby/lib/irb/color_printer.rb, line 38 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