From c9bebec882b2cd5152f1a7de046781394fd2bc0b Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Tue, 4 Nov 2025 18:20:30 +0000 Subject: [PATCH 1/3] [DOC] Tweaks for StringIO#fsync --- 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 874a3a1..986b644 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -454,7 +454,7 @@ strio_self(VALUE self) } /* - * Returns 0. Just for compatibility to IO. + * Returns 0; for compatibility with IO. */ static VALUE strio_0(VALUE self) From 47de8f5401f3b2bd886ed1943508850b40d5cfca Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Tue, 4 Nov 2025 18:31:13 +0000 Subject: [PATCH 2/3] [DOC] Doc for StringIO#size --- doc/stringio/size.rdoc | 5 +++++ ext/stringio/stringio.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 doc/stringio/size.rdoc diff --git a/doc/stringio/size.rdoc b/doc/stringio/size.rdoc new file mode 100644 index 0000000..9323adf --- /dev/null +++ b/doc/stringio/size.rdoc @@ -0,0 +1,5 @@ +Returns the number of bytes in the string in +self+: + + StringIO.new('hello').size # => 5 # Five 1-byte characters. + StringIO.new('тест').size # => 8 # Four 2-byte characters. + StringIO.new('こんにちは').size # => 15 # Five 3-byte characters. diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 986b644..5c90df4 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -1998,10 +1998,10 @@ strio_syswrite_nonblock(int argc, VALUE *argv, VALUE self) /* * call-seq: - * strio.length -> integer - * strio.size -> integer + * size -> integer + * + * :include: stringio/size.rdoc * - * Returns the size of the buffer string. */ static VALUE strio_size(VALUE self) From bee1c2941e2b3f5d5e099917d7286a34371f17f3 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Wed, 5 Nov 2025 01:51:17 +0000 Subject: [PATCH 3/3] [DOC] Doc for StringIO#size --- 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 5c90df4..de09380 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -454,7 +454,7 @@ strio_self(VALUE self) } /* - * Returns 0; for compatibility with IO. + * Returns 0. Just for compatibility to IO. */ static VALUE strio_0(VALUE self)