Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using arbitrary puts to print output #580

Open
st0012 opened this issue May 14, 2023 · 1 comment · May be fixed by #1025
Open

Avoid using arbitrary puts to print output #580

st0012 opened this issue May 14, 2023 · 1 comment · May be fixed by #1025

Comments

@st0012
Copy link
Member

st0012 commented May 14, 2023

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).

@st0012
Copy link
Member Author

st0012 commented Aug 7, 2023

I think a possible direction is to:

  1. Make InputMethod act as IOMethod. That is, make it responsible for output too (by adding puts and print methods to it?) as Reline/ReadlineInputMethod both already hold @stdout anyway.
  2. Change all Kernel#puts invocation to irb_context.io.puts (with some refactors, ofc).

@QWYNG QWYNG linked a pull request Nov 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant