Class: Tiramisu::PrettyPrint
- Inherits:
-
PP
- Object
- PP
- Tiramisu::PrettyPrint
- Defined in:
- lib/tiramisu/pretty_print.rb
Constant Summary collapse
- OBJECT_LITERAL_FORMAT =
"\e[32m%s\e[0m".freeze
Instance Method Summary collapse
Instance Method Details
#text(str, width = str.length) ⇒ Object
40 41 42 43 44 45 46 47 48 |
# 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 |