summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchneems <richard.schneeman+foo@gmail.com>2024-11-15 10:02:58 -0600
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2026-03-23 11:00:31 +0900
commit8136b4e5a8a53574dfe74c9766a37250b4f3f298 (patch)
treed87333b2d557eaa447cca81de9ee7aa975526ed4
parent400d94dcdf75bba7b3f95b0033671181a2fc2c0c (diff)
[ruby/syntax_suggest] Explain why class exists
https://github.com/ruby/syntax_suggest/commit/8c36b0cb35
-rw-r--r--lib/syntax_suggest/mini_stringio.rb4
1 files changed, 4 insertions, 0 deletions
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