From 53ce4ce085ad3be97b2a9ccb5be187cae8f3eae2 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Wed, 6 May 2026 18:32:41 -0500 Subject: [PATCH 1/6] [DOC] Doc for Pathname#binread --- pathname_builtin.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 03b71f79868aac..1d7e0354ba48f3 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -1105,8 +1105,12 @@ def each_line(...) # :yield: line # def read(...) File.read(@path, ...) end - # See File.binread. Returns all the bytes from the file, or the first +N+ - # if specified. + # call-seq: + # binread(length = nil, offset = 0) -> string or nil + # + # Behaves like #read, except that the file is opened in binary mode + # with ASCII-8BIT encoding. + # def binread(...) File.binread(@path, ...) end # See File.readlines. Returns all the lines from the file. From 1b8c09e25798ca2293252602921f2087778c5172 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Wed, 6 May 2026 18:32:58 -0500 Subject: [PATCH 2/6] [DOC] Doc for Pathname#binwrite (#16869) --- pathname_builtin.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 1d7e0354ba48f3..484780da947701 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -1156,9 +1156,11 @@ def sysopen(...) File.sysopen(@path, ...) end # def write(...) File.write(@path, ...) end - # Writes +contents+ to the file, opening it in binary mode. + # call-seq: + # binwrite(string, offset = 0, **opts) -> nonnegative_integer # - # See File.binwrite. + # Behaves like #write, except that the file is opened in binary mode + # with ASCII-8BIT encoding. def binwrite(...) File.binwrite(@path, ...) end # call-seq: From 773cb49eb894fa08fe9b8d550940cb0dd89bd1e1 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Wed, 6 May 2026 18:38:23 -0500 Subject: [PATCH 3/6] [DOC] Doc for Pathname.blockdev? and Pathname.chardev? (#16879) --- pathname_builtin.rb | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 484780da947701..60f936632fc120 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -1348,10 +1348,34 @@ def realdirpath(...) self.class.new(File.realdirpath(@path, ...)) end class Pathname # * FileTest * - # See FileTest.blockdev?. + # call-seq: + # blockdev? => true or false + # + # Returns whether +self+ represents a block device + # (i.e., a random-access device): + # + # Pathname.new('/dev/nvme0n1').blockdev? # => true + # Pathname.new('/dev/loop0').blockdev? # => true + # Pathname.new('/dev/tty').blockdev? # => false + # Pathname.new('/dev/null').blockdev? # => false + # Pathname.new('nosuch').blockdev? # => false + # + # The returned value is OS-dependent; on Windows, almost always +false+. def blockdev?() FileTest.blockdev?(@path) end - # See FileTest.chardev?. + # call-seq: + # chardev? => true or false + # + # Returns whether +self+ represents a character device + # (i.e., a sequential-access device): + # + # Pathname.new('/dev/tty').chardev? # => true + # Pathname.new('/dev/null').chardev? # => true + # Pathname.new('/dev/nvme0n1').chardev? # => false + # Pathname.new('/dev/loop0').chardev? # => false + # Pathname.new('nosuch').chardev? # => false + # + # The returned value is OS-dependent; on Windows, almost always +false+. def chardev?() FileTest.chardev?(@path) end # Tests the file is empty. From aa9d3a28a5ab4504d6a72dc65611e6f57080a070 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 4 May 2026 20:11:57 -0400 Subject: [PATCH 4/6] [DOC] Improve docs for ObjectSpace.count_objects --- gc.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/gc.c b/gc.c index fa903752bf111e..d0dc70ff7fb356 100644 --- a/gc.c +++ b/gc.c @@ -2709,29 +2709,34 @@ count_objects_i(VALUE obj, void *d) /* * call-seq: - * ObjectSpace.count_objects([result_hash]) -> hash + * ObjectSpace.count_objects(result_hash = {}) -> hash * - * Counts all objects grouped by type. + * Counts the number of objects, grouped by type. * - * It returns a hash, such as: - * { - * TOTAL: 10000, - * FREE: 3011, - * T_OBJECT: 6, - * T_CLASS: 404, - * # ... - * } + * It returns a hash that looks like: * - * The contents of the returned hash are implementation specific. - * It may be changed in future. + * { + * TOTAL: 10000, + * FREE: 3011, + * T_OBJECT: 6, + * T_CLASS: 404, + * # ... + * } * - * The keys starting with +:T_+ means live objects. + * The contents of the returned hash are implementation specific and + * may be changed in future versions without notice. + * + * The keys starting with +:T_+ are live objects of a particular type. * For example, +:T_ARRAY+ is the number of arrays. - * +:FREE+ means object slots which is not used now. - * +:TOTAL+ means sum of above. + * + * The key +:FREE+ is the number of object slots which are empty. + * + * The key +:TOTAL+ is the total number of slots (which is the sum of + * all of the other values). * * If the optional argument +result_hash+ is given, - * it is overwritten and returned. This is intended to avoid probe effect. + * it is overwritten and returned. + * This is intended to avoid the probe effect. * * h = {} * ObjectSpace.count_objects(h) From dea0cae04a436addd25e86cf94e2dd7975574dfa Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 17 Mar 2026 23:09:50 -0700 Subject: [PATCH 5/6] [ruby/io-wait] Fix race condition in TestIOWait#test_wait Replace `sleep 0.1` with `IO.select([@r])` to reliably wait for data to arrive before asserting readability with a zero timeout. The fixed sleep was insufficient on slow Windows CI runners, causing sporadic failures. This matches the approach already used in test_wait_readable. https://github.com/ruby/io-wait/commit/dd32ec3682 --- test/io/wait/test_io_wait.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/io/wait/test_io_wait.rb b/test/io/wait/test_io_wait.rb index ffe3b1f760a626..c532638e0990f9 100644 --- a/test/io/wait/test_io_wait.rb +++ b/test/io/wait/test_io_wait.rb @@ -23,7 +23,7 @@ def test_wait omit 'unstable on MinGW' if /mingw/ =~ RUBY_PLATFORM assert_nil @r.wait(0) @w.syswrite "." - sleep 0.1 + IO.select([@r]) assert_equal @r, @r.wait(0) end From 49d86f01c0311543fdaf9db098692a2192bcf7db Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 7 May 2026 09:46:32 +0900 Subject: [PATCH 6/6] Stop to sync cgi and pathname changes --- tool/sync_default_gems.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 7c55ce8628ff13..5727ee00c57d1b 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -108,12 +108,6 @@ def lib((upstream, branch), gemspec_in_subdir: false) ]), "open-uri": lib("ruby/open-uri"), English: lib("ruby/English"), - cgi: repo("ruby/cgi", [ - ["ext/cgi", "ext/cgi"], - ["lib/cgi/escape.rb", "lib/cgi/escape.rb"], - ["test/cgi/test_cgi_escape.rb", "test/cgi/test_cgi_escape.rb"], - ["test/cgi/update_env.rb", "test/cgi/update_env.rb"], - ]), date: repo("ruby/date", [ ["doc/date", "doc/date"], ["ext/date", "ext/date"], @@ -202,12 +196,6 @@ def lib((upstream, branch), gemspec_in_subdir: false) optparse: lib("ruby/optparse", gemspec_in_subdir: true).tap { it.mappings << ["doc/optparse", "doc/optparse"] }, - pathname: repo("ruby/pathname", [ - ["ext/pathname/pathname.c", "pathname.c"], - ["lib/pathname_builtin.rb", "pathname_builtin.rb"], - ["lib/pathname.rb", "lib/pathname.rb"], - ["test/pathname", "test/pathname"], - ]), pp: lib("ruby/pp"), prettyprint: lib("ruby/prettyprint"), prism: repo(["ruby/prism", "main"], [ @@ -445,7 +433,7 @@ def sync_default_gems(gem) end def check_prerelease_version(gem) - return if ["rubygems", "mmtk", "cgi", "pathname", "Onigmo"].include?(gem) + return if ["rubygems", "mmtk", "Onigmo"].include?(gem) require "net/https" require "json"