From bf2663ce0645dcf5b375829d31e755e13da9852e Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Sun, 26 Oct 2025 21:35:07 +0100 Subject: [PATCH 01/11] [DOC] Tweaks for String#sum --- doc/string/sum.rdoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/string/sum.rdoc b/doc/string/sum.rdoc index 5de24e6402f692..125611411e34ab 100644 --- a/doc/string/sum.rdoc +++ b/doc/string/sum.rdoc @@ -1,4 +1,4 @@ -Returns a basic +n+-bit checksum of the characters in +self+; +Returns a basic +n+-bit {checksum}[https://en.wikipedia.org/wiki/Checksum] of the characters in +self+; the checksum is the sum of the binary value of each byte in +self+, modulo 2**n - 1: @@ -9,3 +9,5 @@ modulo 2**n - 1: 'こんにちは'.sum # => 2582 This is not a particularly strong checksum. + +Related: see {Querying}[rdoc-ref:String@Querying]. From e3c4298d404d6a2cdfca006bf71f83360f24a5b0 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Sun, 26 Oct 2025 21:59:16 +0100 Subject: [PATCH 02/11] [DOC] Tweaks for String#swapcase! --- string.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/string.c b/string.c index b4585fd3205913..01af7f66351584 100644 --- a/string.c +++ b/string.c @@ -6190,7 +6190,7 @@ rb_pat_search(VALUE pat, VALUE str, long pos, int set_backref_str) * * Like String#sub, except that: * - * - Changed are made to +self+, not to copy of +self+. + * - Changes are made to +self+, not to copy of +self+. * - Returns +self+ if any changes are made, +nil+ otherwise. * * Related: see {Modifying}[rdoc-ref:String@Modifying]. @@ -8203,20 +8203,12 @@ rb_str_capitalize(int argc, VALUE *argv, VALUE str) * call-seq: * swapcase!(mapping) -> self or nil * - * Upcases each lowercase character in +self+; - * downcases uppercase character; - * returns +self+ if any changes were made, +nil+ otherwise: - * - * s = 'Hello World!' # => "Hello World!" - * s.swapcase! # => "hELLO wORLD!" - * s # => "hELLO wORLD!" - * ''.swapcase! # => nil - * - * The casing may be affected by the given +mapping+; - * see {Case Mapping}[rdoc-ref:case_mapping.rdoc]. + * Like String#swapcase, except that: * - * Related: String#swapcase. + * - Changes are made to +self+, not to copy of +self+. + * - Returns +self+ if any changes are made, +nil+ otherwise. * + * Related: see {Modifying}[rdoc-ref:String@Modifying]. */ static VALUE From 836fc00e191c372d858aefd16c9f5836d1c7dc9e Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Sun, 26 Oct 2025 21:49:05 +0100 Subject: [PATCH 03/11] [DOC] Tweaks for String#swapcase --- doc/string/swapcase.rdoc | 19 +++++++++++++++++++ string.c | 14 ++------------ 2 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 doc/string/swapcase.rdoc diff --git a/doc/string/swapcase.rdoc b/doc/string/swapcase.rdoc new file mode 100644 index 00000000000000..93859ec8237fcc --- /dev/null +++ b/doc/string/swapcase.rdoc @@ -0,0 +1,19 @@ +Returns a string containing the characters in +self+, with cases reversed: + +- Each uppercase character is downcased. +- Each lowercase character is upcased. + +Examples: + + 'Hello World!'.swapcase # => "hELLO wORLD!" + 'тест'.swapcase # => "ТЕСТ" + +Some characters (and even character sets) do not have casing: + + '12345'.swapcase # => "12345" + 'こんにちは'.swapcase # => "こんにちは" + +The casing may be affected by the given +mapping+; +see {Case Mapping}[rdoc-ref:case_mapping.rdoc]. + +Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String]. diff --git a/string.c b/string.c index 01af7f66351584..fa6ce7f3ec1d07 100644 --- a/string.c +++ b/string.c @@ -8232,19 +8232,9 @@ rb_str_swapcase_bang(int argc, VALUE *argv, VALUE str) /* * call-seq: - * swapcase(mapping) -> string + * swapcase(mapping) -> new_string * - * Returns a string containing the characters in +self+, with cases reversed; - * each uppercase character is downcased; - * each lowercase character is upcased: - * - * s = 'Hello World!' # => "Hello World!" - * s.swapcase # => "hELLO wORLD!" - * - * The casing may be affected by the given +mapping+; - * see {Case Mapping}[rdoc-ref:case_mapping.rdoc]. - * - * Related: String#swapcase!. + * :include: doc/string/swapcase.rdoc * */ From 9fd32ee414cf8d697839c129052836e74176c40b Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Mon, 27 Oct 2025 22:06:07 -0500 Subject: [PATCH 04/11] [ruby/stringio] [DOC] Doc for StringIO#each_char (https://github.com/ruby/stringio/pull/158) https://github.com/ruby/stringio/commit/ec6bf815ae Co-authored-by: Sutou Kouhei --- ext/stringio/stringio.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index b6ab8cd6cfdeb7..95736fe3852f05 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -1162,12 +1162,44 @@ strio_readbyte(VALUE self) /* * call-seq: - * each_char {|c| ... } -> self + * each_char {|char| ... } -> self * * With a block given, calls the block with each remaining character in the stream; - * see {Character IO}[rdoc-ref:IO@Character+IO]. - * - * With no block given, returns an enumerator. + * positions the stream at end-of-file; + * returns +self+: + * + * chars = [] + * strio = StringIO.new('hello') + * strio.each_char {|char| chars.push(char) } + * strio.eof? # => true + * chars # => ["h", "e", "l", "l", "o"] + * chars = [] + * strio = StringIO.new('тест') + * strio.each_char {|char| chars.push(char) } + * chars # => ["т", "е", "с", "т"] + * chars = [] + * strio = StringIO.new('こんにちは') + * strio.each_char {|char| chars.push(char) } + * chars # => ["こ", "ん", "に", "ち", "は"] + * + * Stream position matters: + * + * chars = [] + * strio = StringIO.new('こんにちは') + * strio.getc # => "こ" + * strio.pos # => 3 # 3-byte character was read. + * strio.each_char {|char| chars.push(char) } + * chars # => ["ん", "に", "ち", "は"] + * + * When at end-of-stream does not call the block: + * + * strio.eof? # => true + * strio.each_char {|char| fail 'Boo!' } + * strio.eof? # => true + * + * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * + * Related: StringIO#each_byte, StringIO#each_codepoint, StringIO#each_line. */ static VALUE strio_each_char(VALUE self) From 218c2805f94dd986108556ccbb6c219969418377 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Mon, 27 Oct 2025 22:09:13 -0500 Subject: [PATCH 05/11] [ruby/stringio] [DOC] Doc for StringIO#each_codepoint (https://github.com/ruby/stringio/pull/159) https://github.com/ruby/stringio/commit/6628d4837b Co-authored-by: Sutou Kouhei --- ext/stringio/stringio.c | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 95736fe3852f05..d58acd114f6946 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -1218,10 +1218,44 @@ strio_each_char(VALUE self) * call-seq: * each_codepoint {|codepoint| ... } -> self * - * With a block given, calls the block with each remaining codepoint in the stream; - * see {Codepoint IO}[rdoc-ref:IO@Codepoint+IO]. + * With a block given, calls the block with each successive codepoint from self; + * sets the position to end-of-stream; + * returns +self+. * - * With no block given, returns an enumerator. + * Each codepoint is the integer value for a character; returns self: + * + * codepoints = [] + * strio = StringIO.new('hello') + * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + * strio.eof? # => true + * codepoints # => [104, 101, 108, 108, 111] + * codepoints = [] + * strio = StringIO.new('тест') + * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + * codepoints # => [1090, 1077, 1089, 1090] + * codepoints = [] + * strio = StringIO.new('こんにちは') + * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + * codepoints # => [12371, 12435, 12395, 12385, 12399] + * + * Position in the stream matters: + * + * codepoints = [] + * strio = StringIO.new('こんにちは') + * strio.getc # => "こ" + * strio.pos # => 3 + * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + * codepoints # => [12435, 12395, 12385, 12399] + * + * When at end-of-stream, the block is not called: + * + * strio.eof? # => true + * strio.each_codepoint {|codepoint| fail 'Boo!' } + * strio.eof? # => true + * + * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * + * Related: StringIO#each_byte, StringIO#each_char, StringIO#each_line. */ static VALUE strio_each_codepoint(VALUE self) From f7eee3427dcc8b644b9fd6c854f3e176cfb8395e Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 27 Oct 2025 20:48:29 -0700 Subject: [PATCH 06/11] [ruby/erb] Version 5.1.2 https://github.com/ruby/erb/commit/daa0e8712f --- lib/erb/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/erb/version.rb b/lib/erb/version.rb index ceca10731e4ce4..adc06d92911ee4 100644 --- a/lib/erb/version.rb +++ b/lib/erb/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true class ERB # The string \ERB version. - VERSION = '5.1.1' + VERSION = '5.1.2' end From 4511e9621a11c99611638267923c4ff8de29410b Mon Sep 17 00:00:00 2001 From: git Date: Tue, 28 Oct 2025 03:50:50 +0000 Subject: [PATCH 07/11] Update default gems list at f7eee3427dcc8b644b9fd6c854f3e1 [ci skip] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index f847fe6817821d..875ac2ecd374aa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -182,7 +182,7 @@ The following default gems are updated. * RubyGems 4.0.0.dev * bundler 4.0.0.dev -* erb 5.1.1 +* erb 5.1.2 * etc 1.4.6 * fcntl 1.3.0 * io-console 0.8.1 From b3191d204b8b4fe4b29cf73cd09a1b83e144f62d Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 27 Oct 2025 20:57:18 -0700 Subject: [PATCH 08/11] [ruby/erb] Version 5.1.3 https://github.com/ruby/erb/commit/e8d382a83e --- lib/erb/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/erb/version.rb b/lib/erb/version.rb index adc06d92911ee4..138bf3988206fc 100644 --- a/lib/erb/version.rb +++ b/lib/erb/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true class ERB # The string \ERB version. - VERSION = '5.1.2' + VERSION = '5.1.3' end From d864bd1a581417dd8ad4e2e89b80ea23e26ac74c Mon Sep 17 00:00:00 2001 From: git Date: Tue, 28 Oct 2025 03:58:48 +0000 Subject: [PATCH 09/11] Update default gems list at b3191d204b8b4fe4b29cf73cd09a1b [ci skip] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 875ac2ecd374aa..047bdeeb3e235f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -182,7 +182,7 @@ The following default gems are updated. * RubyGems 4.0.0.dev * bundler 4.0.0.dev -* erb 5.1.2 +* erb 5.1.3 * etc 1.4.6 * fcntl 1.3.0 * io-console 0.8.1 From 02d53bab5675665951a6340328a09f914bf23f21 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Mon, 27 Oct 2025 21:41:41 -0500 Subject: [PATCH 10/11] [ruby/stringio] [DOC] Doc for StringIO#each_byte (https://github.com/ruby/stringio/pull/157) https://github.com/ruby/stringio/commit/624ce56b4e Co-authored-by: Sutou Kouhei --- ext/stringio/stringio.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index d58acd114f6946..146f9c0e7d3e71 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -937,9 +937,41 @@ strio_get_sync(VALUE self) * each_byte {|byte| ... } -> self * * With a block given, calls the block with each remaining byte in the stream; - * see {Byte IO}[rdoc-ref:IO@Byte+IO]. + * positions the stream at end-of-file; + * returns +self+: + * + * bytes = [] + * strio = StringIO.new('hello') # Five 1-byte characters. + * strio.each_byte {|byte| bytes.push(byte) } + * strio.eof? # => true + * bytes # => [104, 101, 108, 108, 111] + * bytes = [] + * strio = StringIO.new('тест') # Four 2-byte characters. + * strio.each_byte {|byte| bytes.push(byte) } + * bytes # => [209, 130, 208, 181, 209, 129, 209, 130] + * bytes = [] + * strio = StringIO.new('こんにちは') # Five 3-byte characters. + * strio.each_byte {|byte| bytes.push(byte) } + * bytes # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] + * + * The position in the stream matters: + * + * bytes = [] + * strio = StringIO.new('こんにちは') + * strio.getc # => "こ" + * strio.pos # => 3 # 3-byte character was read. + * strio.each_byte {|byte| bytes.push(byte) } + * bytes # => [227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] * - * With no block given, returns an enumerator. + * If at end-of-file, does not call the block: + * + * strio.eof? # => true + * strio.each_byte {|byte| fail 'Boo!' } + * strio.eof? # => true + * + * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * + * Related: StringIO#each_char, StringIO#each_codepoint, StringIO#each_line. */ static VALUE strio_each_byte(VALUE self) @@ -1696,7 +1728,7 @@ strio_readline(int argc, VALUE *argv, VALUE self) * "Fifth line" * ``` * - * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. * * Related: StringIO.each_byte, StringIO.each_char, StringIO.each_codepoint. */ From 0f5c69b317b5ccf00739de77058b01d08cebeb3f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 28 Oct 2025 12:37:18 +0900 Subject: [PATCH 11/11] [DOC] Moved non ASCII documents to separated files C99 does not declare ways to designate the charset encoding of the source file. We can assume just US-ASCII characters will be safe. --- doc/stringio/each_byte.rdoc | 34 ++++++++++ doc/stringio/each_char.rdoc | 34 ++++++++++ doc/stringio/each_codepoint.rdoc | 36 +++++++++++ ext/stringio/stringio.c | 107 +------------------------------ 4 files changed, 107 insertions(+), 104 deletions(-) create mode 100644 doc/stringio/each_byte.rdoc create mode 100644 doc/stringio/each_char.rdoc create mode 100644 doc/stringio/each_codepoint.rdoc diff --git a/doc/stringio/each_byte.rdoc b/doc/stringio/each_byte.rdoc new file mode 100644 index 00000000000000..65e81c53a7cd0f --- /dev/null +++ b/doc/stringio/each_byte.rdoc @@ -0,0 +1,34 @@ +With a block given, calls the block with each remaining byte in the stream; +positions the stream at end-of-file; +returns +self+: + + bytes = [] + strio = StringIO.new('hello') # Five 1-byte characters. + strio.each_byte {|byte| bytes.push(byte) } + strio.eof? # => true + bytes # => [104, 101, 108, 108, 111] + bytes = [] + strio = StringIO.new('тест') # Four 2-byte characters. + strio.each_byte {|byte| bytes.push(byte) } + bytes # => [209, 130, 208, 181, 209, 129, 209, 130] + bytes = [] + strio = StringIO.new('こんにちは') # Five 3-byte characters. + strio.each_byte {|byte| bytes.push(byte) } + bytes # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] + +The position in the stream matters: + + bytes = [] + strio = StringIO.new('こんにちは') + strio.getc # => "こ" + strio.pos # => 3 # 3-byte character was read. + strio.each_byte {|byte| bytes.push(byte) } + bytes # => [227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] + +If at end-of-file, does not call the block: + + strio.eof? # => true + strio.each_byte {|byte| fail 'Boo!' } + strio.eof? # => true + +With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. diff --git a/doc/stringio/each_char.rdoc b/doc/stringio/each_char.rdoc new file mode 100644 index 00000000000000..d0b5e4082cc4d3 --- /dev/null +++ b/doc/stringio/each_char.rdoc @@ -0,0 +1,34 @@ +With a block given, calls the block with each remaining character in the stream; +positions the stream at end-of-file; +returns +self+: + + chars = [] + strio = StringIO.new('hello') + strio.each_char {|char| chars.push(char) } + strio.eof? # => true + chars # => ["h", "e", "l", "l", "o"] + chars = [] + strio = StringIO.new('тест') + strio.each_char {|char| chars.push(char) } + chars # => ["т", "е", "с", "т"] + chars = [] + strio = StringIO.new('こんにちは') + strio.each_char {|char| chars.push(char) } + chars # => ["こ", "ん", "に", "ち", "は"] + +Stream position matters: + + chars = [] + strio = StringIO.new('こんにちは') + strio.getc # => "こ" + strio.pos # => 3 # 3-byte character was read. + strio.each_char {|char| chars.push(char) } + chars # => ["ん", "に", "ち", "は"] + +When at end-of-stream does not call the block: + + strio.eof? # => true + strio.each_char {|char| fail 'Boo!' } + strio.eof? # => true + +With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. diff --git a/doc/stringio/each_codepoint.rdoc b/doc/stringio/each_codepoint.rdoc new file mode 100644 index 00000000000000..ede16de599cf0c --- /dev/null +++ b/doc/stringio/each_codepoint.rdoc @@ -0,0 +1,36 @@ +With a block given, calls the block with each successive codepoint from self; +sets the position to end-of-stream; +returns +self+. + +Each codepoint is the integer value for a character; returns self: + + codepoints = [] + strio = StringIO.new('hello') + strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + strio.eof? # => true + codepoints # => [104, 101, 108, 108, 111] + codepoints = [] + strio = StringIO.new('тест') + strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + codepoints # => [1090, 1077, 1089, 1090] + codepoints = [] + strio = StringIO.new('こんにちは') + strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + codepoints # => [12371, 12435, 12395, 12385, 12399] + +Position in the stream matters: + + codepoints = [] + strio = StringIO.new('こんにちは') + strio.getc # => "こ" + strio.pos # => 3 + strio.each_codepoint {|codepoint| codepoints.push(codepoint) } + codepoints # => [12435, 12395, 12385, 12399] + +When at end-of-stream, the block is not called: + + strio.eof? # => true + strio.each_codepoint {|codepoint| fail 'Boo!' } + strio.eof? # => true + +With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 146f9c0e7d3e71..b96010dfbf3f96 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -936,40 +936,7 @@ strio_get_sync(VALUE self) * call-seq: * each_byte {|byte| ... } -> self * - * With a block given, calls the block with each remaining byte in the stream; - * positions the stream at end-of-file; - * returns +self+: - * - * bytes = [] - * strio = StringIO.new('hello') # Five 1-byte characters. - * strio.each_byte {|byte| bytes.push(byte) } - * strio.eof? # => true - * bytes # => [104, 101, 108, 108, 111] - * bytes = [] - * strio = StringIO.new('тест') # Four 2-byte characters. - * strio.each_byte {|byte| bytes.push(byte) } - * bytes # => [209, 130, 208, 181, 209, 129, 209, 130] - * bytes = [] - * strio = StringIO.new('こんにちは') # Five 3-byte characters. - * strio.each_byte {|byte| bytes.push(byte) } - * bytes # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] - * - * The position in the stream matters: - * - * bytes = [] - * strio = StringIO.new('こんにちは') - * strio.getc # => "こ" - * strio.pos # => 3 # 3-byte character was read. - * strio.each_byte {|byte| bytes.push(byte) } - * bytes # => [227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175] - * - * If at end-of-file, does not call the block: - * - * strio.eof? # => true - * strio.each_byte {|byte| fail 'Boo!' } - * strio.eof? # => true - * - * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * :include: stringio/each_byte.rdoc * * Related: StringIO#each_char, StringIO#each_codepoint, StringIO#each_line. */ @@ -1196,40 +1163,7 @@ strio_readbyte(VALUE self) * call-seq: * each_char {|char| ... } -> self * - * With a block given, calls the block with each remaining character in the stream; - * positions the stream at end-of-file; - * returns +self+: - * - * chars = [] - * strio = StringIO.new('hello') - * strio.each_char {|char| chars.push(char) } - * strio.eof? # => true - * chars # => ["h", "e", "l", "l", "o"] - * chars = [] - * strio = StringIO.new('тест') - * strio.each_char {|char| chars.push(char) } - * chars # => ["т", "е", "с", "т"] - * chars = [] - * strio = StringIO.new('こんにちは') - * strio.each_char {|char| chars.push(char) } - * chars # => ["こ", "ん", "に", "ち", "は"] - * - * Stream position matters: - * - * chars = [] - * strio = StringIO.new('こんにちは') - * strio.getc # => "こ" - * strio.pos # => 3 # 3-byte character was read. - * strio.each_char {|char| chars.push(char) } - * chars # => ["ん", "に", "ち", "は"] - * - * When at end-of-stream does not call the block: - * - * strio.eof? # => true - * strio.each_char {|char| fail 'Boo!' } - * strio.eof? # => true - * - * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * :include: stringio/each_char.rdoc * * Related: StringIO#each_byte, StringIO#each_codepoint, StringIO#each_line. */ @@ -1250,42 +1184,7 @@ strio_each_char(VALUE self) * call-seq: * each_codepoint {|codepoint| ... } -> self * - * With a block given, calls the block with each successive codepoint from self; - * sets the position to end-of-stream; - * returns +self+. - * - * Each codepoint is the integer value for a character; returns self: - * - * codepoints = [] - * strio = StringIO.new('hello') - * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } - * strio.eof? # => true - * codepoints # => [104, 101, 108, 108, 111] - * codepoints = [] - * strio = StringIO.new('тест') - * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } - * codepoints # => [1090, 1077, 1089, 1090] - * codepoints = [] - * strio = StringIO.new('こんにちは') - * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } - * codepoints # => [12371, 12435, 12395, 12385, 12399] - * - * Position in the stream matters: - * - * codepoints = [] - * strio = StringIO.new('こんにちは') - * strio.getc # => "こ" - * strio.pos # => 3 - * strio.each_codepoint {|codepoint| codepoints.push(codepoint) } - * codepoints # => [12435, 12395, 12385, 12399] - * - * When at end-of-stream, the block is not called: - * - * strio.eof? # => true - * strio.each_codepoint {|codepoint| fail 'Boo!' } - * strio.eof? # => true - * - * With no block given, returns a new {Enumerator}[rdoc-ref:Enumerator]. + * :include: stringio/each_codepoint.rdoc * * Related: StringIO#each_byte, StringIO#each_char, StringIO#each_line. */