Ruby's awesome_print to STDERR

599 Views Asked by At

How to make ap function (with its color) outputting to STDERR?

ap bla # this goes to STDOUT
1

There are 1 best solutions below

0
On BEST ANSWER

Use the Kernel#ai method to get the awesome_print String, then pass it to any output stream you want:

STDERR.puts foo.ai