class Tiramisu::PrettyPrint

Constants

OBJECT_LITERAL_FORMAT

Public Instance Methods

text(str, width = str.length) click to toggle source
Calls superclass method
# File lib/tiramisu/pretty_print.rb, line 40
def text str, width = str.length
  if str.include?("\e[")
    super "%s\e[0m" % str, width
  elsif str.start_with?('#<') || str == '=' || str == '>'
    super highlight_object_literal(str), width
  else
    super CodeRay.scan(str, :ruby).term, width
  end
end

Private Instance Methods

highlight_object_literal(object_literal) click to toggle source
# File lib/tiramisu/pretty_print.rb, line 51
def highlight_object_literal object_literal
  OBJECT_LITERAL_FORMAT % object_literal
end