From 4080abecd6f7b2ce6f7e6a6d1801d3d9fcfa9a58 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 7 Dec 2025 18:16:02 +0900 Subject: [PATCH 1/8] Ignore distclean failures Just clean the directory if it exists and is empty. --- prism/srcs.mk | 2 +- prism/srcs.mk.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prism/srcs.mk b/prism/srcs.mk index 167aa4dbe07e89..022662a00b5f30 100644 --- a/prism/srcs.mk +++ b/prism/srcs.mk @@ -14,7 +14,7 @@ prism/$(HAVE_BASERUBY:yes=.srcs.mk.time): \ distclean-prism-srcs:: $(RM) prism/.srcs.mk.time - $(RMDIR) prism + $(RMDIRS) prism || $(NULLCMD) distclean-srcs-local:: distclean-prism-srcs diff --git a/prism/srcs.mk.in b/prism/srcs.mk.in index b67ce993709ac3..cc263fd1b4ef3f 100644 --- a/prism/srcs.mk.in +++ b/prism/srcs.mk.in @@ -22,7 +22,7 @@ prism/$(HAVE_BASERUBY:yes=.srcs.mk.time): \ distclean-prism-srcs:: $(RM) prism/.srcs.mk.time - $(RMDIR) prism + $(RMDIRS) prism || $(NULLCMD) distclean-srcs-local:: distclean-prism-srcs From f2b250c150b947c3b2341796b2ce44dd94002055 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 7 Dec 2025 00:06:21 +0900 Subject: [PATCH 2/8] [ruby/pathname] Define private method `same_paths?` for Ractor-safety https://github.com/ruby/pathname/commit/d33d18e5e2 --- pathname_builtin.rb | 12 +++++------- test/pathname/test_ractor.rb | 5 +++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 3d78619c9e4041..d9c5d5b6bad75d 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -195,14 +195,12 @@ class Pathname # :stopdoc: - SAME_PATHS = if File::FNM_SYSCASE.nonzero? + if File::FNM_SYSCASE.nonzero? # Avoid #zero? here because #casecmp can return nil. - proc {|a, b| a.casecmp(b) == 0} + private def same_paths?(a, b) a.casecmp(b) == 0 end else - proc {|a, b| a == b} + private def same_paths?(a, b) a == b end end - SAME_PATHS.freeze - private_constant :SAME_PATHS attr_reader :path protected :path @@ -836,12 +834,12 @@ def relative_path_from(base_directory) base_prefix, basename = r base_names.unshift basename if basename != '.' end - unless SAME_PATHS[dest_prefix, base_prefix] + unless same_paths?(dest_prefix, base_prefix) raise ArgumentError, "different prefix: #{dest_prefix.inspect} and #{base_directory.inspect}" end while !dest_names.empty? && !base_names.empty? && - SAME_PATHS[dest_names.first, base_names.first] + same_paths?(dest_names.first, base_names.first) dest_names.shift base_names.shift end diff --git a/test/pathname/test_ractor.rb b/test/pathname/test_ractor.rb index f06b7501f3448b..737e4a4111d65c 100644 --- a/test/pathname/test_ractor.rb +++ b/test/pathname/test_ractor.rb @@ -20,6 +20,11 @@ class Ractor x.join(Pathname("b"), Pathname("c")) end assert_equal(Pathname("a/b/c"), r.value) + + r = Ractor.new Pathname("a") do |a| + Pathname("b").relative_path_from(a) + end + assert_equal(Pathname("../b"), r.value) end; end end From 806f2d3533ec5bbf6b4d598b36b1c9de7e786659 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 7 Dec 2025 11:34:11 +0900 Subject: [PATCH 3/8] [ruby/pathname] [DOC] Pathname#freeze https://github.com/ruby/pathname/commit/4580540a2b --- pathname_builtin.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index d9c5d5b6bad75d..17299d42913a93 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -215,6 +215,9 @@ def initialize(path) @path = File.path(path).dup end + # + # Freze self. + # def freeze super @path.freeze From a8a188e1fc8568185c2ca460b5a2e800e9cac4bd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 7 Dec 2025 12:29:41 +0900 Subject: [PATCH 4/8] [ruby/pathname] Add more tests for `Pathname#initialize` https://github.com/ruby/pathname/commit/a2edd25bc1 --- test/pathname/test_pathname.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index e2d6a09fb2f0c0..10ab1542205fa7 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -485,6 +485,13 @@ def test_initialize p2 = Pathname.new(p1) assert_equal(p1, p2) + obj = Object.new + assert_raise(TypeError) { Pathname.new(obj) } + + obj = Object.new + def obj.to_path; "a/path"; end + assert_equal("a/path", Pathname.new(obj).to_s) + obj = Object.new def obj.to_str; "a/b"; end assert_equal("a/b", Pathname.new(obj).to_s) @@ -494,6 +501,10 @@ def test_initialize_nul assert_raise(ArgumentError) { Pathname.new("a\0") } end + def test_initialize_encoding + assert_raise(Encoding::CompatibilityError) { Pathname.new("a".encode(Encoding::UTF_32BE)) } + end + def test_global_constructor p = Pathname.new('a') assert_equal(p, Pathname('a')) From db6071b5216ac58976f8ab8181ff6eab02dfa8be Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 7 Dec 2025 12:31:42 +0900 Subject: [PATCH 5/8] [ruby/pathname] Raise the previous message Fix ruby/pathname#75. https://github.com/ruby/pathname/commit/5ba967b274 --- pathname_builtin.rb | 2 ++ test/pathname/test_pathname.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 17299d42913a93..878603d4d69cd0 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -213,6 +213,8 @@ class Pathname # def initialize(path) @path = File.path(path).dup + rescue TypeError => e + raise e.class, "Pathname.new requires a String, #to_path or #to_str", cause: nil end # diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 10ab1542205fa7..3114d1458d229d 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -486,7 +486,7 @@ def test_initialize assert_equal(p1, p2) obj = Object.new - assert_raise(TypeError) { Pathname.new(obj) } + assert_raise_with_message(TypeError, /#to_path or #to_str/) { Pathname.new(obj) } obj = Object.new def obj.to_path; "a/path"; end From 379d22ce8418448ade3d410e5c76dd2ca0c7a8cf Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Sun, 7 Dec 2025 16:35:04 +0000 Subject: [PATCH 6/8] Bump RDoc version to 6.17.0 (#15439) --- gems/bundled_gems | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gems/bundled_gems b/gems/bundled_gems index 180e1dffcd4dae..bdda3311d0eb07 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -39,7 +39,7 @@ ostruct 0.6.3 https://github.com/ruby/ostruct pstore 0.2.0 https://github.com/ruby/pstore benchmark 0.5.0 https://github.com/ruby/benchmark logger 1.7.0 https://github.com/ruby/logger -rdoc 6.16.1 https://github.com/ruby/rdoc +rdoc 6.17.0 https://github.com/ruby/rdoc win32ole 1.9.2 https://github.com/ruby/win32ole irb 1.15.3 https://github.com/ruby/irb reline 0.6.3 https://github.com/ruby/reline From a4d142137332e449c2e037fa123a9d477d22093a Mon Sep 17 00:00:00 2001 From: git Date: Sun, 7 Dec 2025 16:35:47 +0000 Subject: [PATCH 7/8] [DOC] Update bundled gems list at 379d22ce8418448ade3d410e5c76dd --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3468f479596293..24a36475360569 100644 --- a/NEWS.md +++ b/NEWS.md @@ -213,7 +213,7 @@ The following bundled gems are promoted from default gems. * pstore 0.2.0 * benchmark 0.5.0 * logger 1.7.0 -* rdoc 6.16.1 +* rdoc 6.17.0 * win32ole 1.9.2 * irb 1.15.3 * reline 0.6.3 From 4f900c35bc01e12b948703b9e4b4f5d0e803f073 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 7 Dec 2025 10:24:08 -0500 Subject: [PATCH 8/8] Output ivar length for T_OBJECT in obj_info --- gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gc.c b/gc.c index c660d1491f3a6d..5e3e44e726704d 100644 --- a/gc.c +++ b/gc.c @@ -4841,11 +4841,11 @@ rb_raw_obj_info_buitin_type(char *const buff, const size_t buff_size, const VALU APPEND_F("(too_complex) len:%zu", hash_len); } else { - APPEND_F("(embed) len:%d", ROBJECT_FIELDS_CAPACITY(obj)); + APPEND_F("(embed) len:%d capa:%d", RSHAPE_LEN(RBASIC_SHAPE_ID(obj)), ROBJECT_FIELDS_CAPACITY(obj)); } } else { - APPEND_F("len:%d ptr:%p", ROBJECT_FIELDS_CAPACITY(obj), (void *)ROBJECT_FIELDS(obj)); + APPEND_F("len:%d capa:%d ptr:%p", RSHAPE_LEN(RBASIC_SHAPE_ID(obj)), ROBJECT_FIELDS_CAPACITY(obj), (void *)ROBJECT_FIELDS(obj)); } } break;