From a4aadc6f235eaf865bffb0c81f61e6b3dd613242 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Sat, 25 Oct 2025 22:08:12 +0100 Subject: [PATCH 1/4] [DOC] Tweaks for StringIO.closed_write? --- ext/stringio/stringio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index ca71bb4..1d295dd 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -643,7 +643,15 @@ strio_closed_read(VALUE self) * call-seq: * closed_write? -> true or false * - * Returns +true+ if +self+ is closed for writing, +false+ otherwise. + * Returns whether +self+ is closed for writing: + * + * + * strio = StringIO.new + * strio.closed_write? # => false + * strio.close_write + * strio.closed_write? # => true + * + * Related: StringIO.closed?, StringIO.closed_read?. */ static VALUE strio_closed_write(VALUE self) From dcdf62606d134c69cf93bda712d060e8521ba4b9 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sun, 26 Oct 2025 12:16:19 -0500 Subject: [PATCH 2/4] Update ext/stringio/stringio.c Co-authored-by: Sutou Kouhei --- ext/stringio/stringio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 1d295dd..fcbb8f9 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -645,7 +645,6 @@ strio_closed_read(VALUE self) * * Returns whether +self+ is closed for writing: * - * * strio = StringIO.new * strio.closed_write? # => false * strio.close_write From 45f867c98cb3efed2b975f292e89e18cc0902554 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sun, 26 Oct 2025 12:18:51 -0500 Subject: [PATCH 3/4] Update stringio.c Fix method refs in Related. --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index fcbb8f9..f658458 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -650,7 +650,7 @@ strio_closed_read(VALUE self) * strio.close_write * strio.closed_write? # => true * - * Related: StringIO.closed?, StringIO.closed_read?. + * Related: StringIO#closed?, StringIO#closed_read?. */ static VALUE strio_closed_write(VALUE self) From 58fc6c8e82e8d2dd970fb2a62eef83d74c145176 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 27 Oct 2025 10:00:57 +0900 Subject: [PATCH 4/4] Add `close_write` --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index f658458..d51400b 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -650,7 +650,7 @@ strio_closed_read(VALUE self) * strio.close_write * strio.closed_write? # => true * - * Related: StringIO#closed?, StringIO#closed_read?. + * Related: StringIO#close_write, StringIO#closed?, StringIO#closed_read?. */ static VALUE strio_closed_write(VALUE self)