From 90309d1a57c3ecd4164faaaa0aa1d27212f88492 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Sat, 25 Oct 2025 21:45:52 +0100 Subject: [PATCH 1/4] [DOC] Tweaks for StringIO#close_write --- ext/stringio/stringio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index ca71bb48..0f0bc3e1 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -593,9 +593,14 @@ strio_close_read(VALUE self) * call-seq: * close_write -> nil * - * Closes +self+ for writing; closed-read setting remains unchanged. + * Closes +self+ for writing; returns +nil+: * - * Raises IOError if writing is attempted. + * strio = StringIO.new + * strio.closed_write? # => false + * strio.close_write # => nil + * strio.closed_write? # => true + * strio.closed_read? # => false + * strio.write('foo') # Raises IOError: not opened for writing * * Related: StringIO#close, StringIO#close_read. */ From 0f67a8ec42084b0bc0f774ae437bff3d26742ec2 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Mon, 27 Oct 2025 04:31:08 +0100 Subject: [PATCH 2/4] [DOC] Tweaks for StringIO#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 0f0bc3e1..67d5ca5d 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -593,7 +593,7 @@ strio_close_read(VALUE self) * call-seq: * close_write -> nil * - * Closes +self+ for writing; returns +nil+: + * Closes +self+ for writing; closed-read setting remains unchanged; returns +nil+: * * strio = StringIO.new * strio.closed_write? # => false From bf34d744a95a67cf0fd17cc78c707bd4b4ba504e Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 27 Oct 2025 13:22:22 +0900 Subject: [PATCH 3/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 67d5ca5d..01783ba8 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -602,7 +602,7 @@ strio_close_read(VALUE self) * strio.closed_read? # => false * strio.write('foo') # Raises IOError: not opened for writing * - * Related: StringIO#close, StringIO#close_read. + * Related: StringIO#close, StringIO#close_read, StringIO#close_write?. */ static VALUE strio_close_write(VALUE self) From d4fd4e3924baf752734ffef0327f9a5ba0cbe886 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 27 Oct 2025 13:22:45 +0900 Subject: [PATCH 4/4] Fix a typo --- 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 01783ba8..fcb7198f 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -602,7 +602,7 @@ strio_close_read(VALUE self) * strio.closed_read? # => false * strio.write('foo') # Raises IOError: not opened for writing * - * Related: StringIO#close, StringIO#close_read, StringIO#close_write?. + * Related: StringIO#close, StringIO#close_read, StringIO#closed_write?. */ static VALUE strio_close_write(VALUE self)