irb
irb copied to clipboard
Avoid using arbitrary `puts` to print output
IRB currently prints most of its output to STDOUT by calling puts directly. This means changing the output target is very difficult (e.g. print to a socket instead, which ruby/debug supports).
I think a possible direction is to:
- Make
InputMethodact asIOMethod. That is, make it responsible for output too (by addingputsandprintmethods to it?) as Reline/ReadlineInputMethod both already hold@stdoutanyway. - Change all
Kernel#putsinvocation toirb_context.io.puts(with some refactors, ofc).