From 3a547e2539124e8ecd9b09f747fb8f516295134e Mon Sep 17 00:00:00 2001 From: Schneems Date: Fri, 15 Nov 2024 10:02:58 -0600 Subject: [PATCH] [ruby/syntax_suggest] Explain why class exists https://github.com/ruby/syntax_suggest/commit/8c36b0cb35 --- lib/syntax_suggest/mini_stringio.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/syntax_suggest/mini_stringio.rb b/lib/syntax_suggest/mini_stringio.rb index 2903275ea2..1a82572eeb 100644 --- a/lib/syntax_suggest/mini_stringio.rb +++ b/lib/syntax_suggest/mini_stringio.rb @@ -5,6 +5,10 @@ module SyntaxSuggest # # Acts like a StringIO with reduced API, but without having to require that # class. + # + # The original codebase emitted directly to $stderr, but now SyntaxError#detailed_message + # needs a string output. To accomplish that we kept the original print infrastructure in place and + # added this class to accumulate the print output into a string. class MiniStringIO EMPTY_ARG = Object.new