From 2dcf1f74a417c01c64f45f1ea73d9346ab444774 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 29 Oct 2025 15:49:48 +0900 Subject: [PATCH 01/14] [ruby/timeout] v0.4.4 https://github.com/ruby/timeout/commit/f42b47d383 --- lib/timeout.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timeout.rb b/lib/timeout.rb index f5f232ad2ae072..e1f0a4a78c6f59 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -20,7 +20,7 @@ module Timeout # The version - VERSION = "0.4.3" + VERSION = "0.4.4" # Internal error raised to when a timeout is triggered. class ExitException < Exception From bb5f5a5293191d8d81dea4f4da3add47584b1854 Mon Sep 17 00:00:00 2001 From: git Date: Wed, 29 Oct 2025 06:58:01 +0000 Subject: [PATCH 02/14] Update default gems list at 2dcf1f74a417c01c64f45f1ea73d93 [ci skip] --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index c6bcce74e338f2..2eae6577ed3922 100644 --- a/NEWS.md +++ b/NEWS.md @@ -197,6 +197,7 @@ The following default gems are updated. * resolv 0.6.2 * stringio 3.1.8.dev * strscan 3.1.6.dev +* timeout 0.4.4 * uri 1.0.4 * weakref 0.1.4 * zlib 3.2.2 From 337c4bc16384fa44f7a486d550461af93e2e6001 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 29 Oct 2025 16:00:40 +0900 Subject: [PATCH 03/14] [ruby/date] v3.5.0 https://github.com/ruby/date/commit/d535f7e85f --- ext/date/lib/date.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb index aa630eb6d172b5..b33f6e65f466b0 100644 --- a/ext/date/lib/date.rb +++ b/ext/date/lib/date.rb @@ -4,7 +4,7 @@ require 'date_core' class Date - VERSION = "3.4.1" # :nodoc: + VERSION = "3.5.0" # :nodoc: # call-seq: # infinite? -> false From b8f7c18aa83d14e14357b2013758b439ca572722 Mon Sep 17 00:00:00 2001 From: git Date: Wed, 29 Oct 2025 07:10:08 +0000 Subject: [PATCH 04/14] Update default gems list at 337c4bc16384fa44f7a486d550461a [ci skip] --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 2eae6577ed3922..5c9900cbb1ab68 100644 --- a/NEWS.md +++ b/NEWS.md @@ -182,6 +182,7 @@ The following default gems are updated. * RubyGems 4.0.0.dev * bundler 4.0.0.dev +* date 3.5.0 * erb 5.1.3 * etc 1.4.6 * fcntl 1.3.0 From 8f0b9b27cec1ec187c6357586dc98d17c42c5c0a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 29 Oct 2025 16:34:26 +0900 Subject: [PATCH 05/14] [ruby/fileutils] v1.8.0 https://github.com/ruby/fileutils/commit/29de582f68 --- lib/fileutils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 6ef71d75ef39f3..0706e007ca4979 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -181,7 +181,7 @@ # module FileUtils # The version number. - VERSION = "1.7.3" + VERSION = "1.8.0" def self.private_module_function(name) #:nodoc: module_function name From b55e91156c520109c961b4a0626f567821fd6f31 Mon Sep 17 00:00:00 2001 From: git Date: Wed, 29 Oct 2025 07:36:10 +0000 Subject: [PATCH 06/14] Update default gems list at 8f0b9b27cec1ec187c6357586dc98d [ci skip] --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 5c9900cbb1ab68..0b622064720f22 100644 --- a/NEWS.md +++ b/NEWS.md @@ -186,6 +186,7 @@ The following default gems are updated. * erb 5.1.3 * etc 1.4.6 * fcntl 1.3.0 +* fileutils 1.8.0 * io-console 0.8.1 * io-nonblock 0.3.2 * io-wait 0.3.2 From 6e618a2c79973557847ad23d5a5d9f97146068ba Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 29 Oct 2025 16:48:50 +0900 Subject: [PATCH 07/14] Added repl_type_completor to bundled gems section --- doc/maintainers.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/maintainers.md b/doc/maintainers.md index fdd7697ee6b370..244912cb20c9ca 100644 --- a/doc/maintainers.md +++ b/doc/maintainers.md @@ -622,6 +622,12 @@ It may needs to make consensus on ruby-core/ruby-dev before making major changes * https://github.com/ruby/fiddle * https://rubygems.org/gems/fiddle +#### repl_type_completor + +* Tomoya Ishida ([tompng]) +* https://github.com/ruby/repl_type_completor +* https://rubygems.org/gems/repl_type_completor + ## Platform Maintainers ### mswin64 (Microsoft Windows) From 12350eb9e0d3317da57b5a37c0c2810946b48850 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 28 Oct 2025 21:55:18 +0900 Subject: [PATCH 08/14] [Bug #21625] Allow io/wait methods with `IO#ungetc` in text mode --- ext/io/wait/wait.c | 8 +++---- io.c | 4 ++-- test/io/wait/test_io_wait_uncommon.rb | 30 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c index 88e6dd2af1fb58..bec04cb727e054 100644 --- a/ext/io/wait/wait.c +++ b/ext/io/wait/wait.c @@ -84,7 +84,7 @@ io_nread(VALUE io) ioctl_arg n; GetOpenFile(io, fptr); - rb_io_check_readable(fptr); + rb_io_check_char_readable(fptr); len = rb_io_read_pending(fptr); if (len > 0) return INT2FIX(len); @@ -143,7 +143,7 @@ io_ready_p(VALUE io) #endif GetOpenFile(io, fptr); - rb_io_check_readable(fptr); + rb_io_check_char_readable(fptr); if (rb_io_read_pending(fptr)) return Qtrue; #ifndef HAVE_RB_IO_WAIT @@ -178,7 +178,7 @@ io_wait_readable(int argc, VALUE *argv, VALUE io) #endif GetOpenFile(io, fptr); - rb_io_check_readable(fptr); + rb_io_check_char_readable(fptr); #ifndef HAVE_RB_IO_WAIT tv = get_timeout(argc, argv, &timerec); @@ -252,7 +252,7 @@ io_wait_priority(int argc, VALUE *argv, VALUE io) rb_io_t *fptr = NULL; RB_IO_POINTER(io, fptr); - rb_io_check_readable(fptr); + rb_io_check_char_readable(fptr); if (rb_io_read_pending(fptr)) return Qtrue; diff --git a/io.c b/io.c index d412d14963bded..78ac0bb2c65d9e 100644 --- a/io.c +++ b/io.c @@ -9832,7 +9832,7 @@ io_wait_readable(int argc, VALUE *argv, VALUE io) rb_io_t *fptr; RB_IO_POINTER(io, fptr); - rb_io_check_readable(fptr); + rb_io_check_char_readable(fptr); if (rb_io_read_pending(fptr)) return Qtrue; @@ -9879,7 +9879,7 @@ io_wait_priority(int argc, VALUE *argv, VALUE io) rb_io_t *fptr = NULL; RB_IO_POINTER(io, fptr); - rb_io_check_readable(fptr); + rb_io_check_char_readable(fptr); if (rb_io_read_pending(fptr)) return Qtrue; diff --git a/test/io/wait/test_io_wait_uncommon.rb b/test/io/wait/test_io_wait_uncommon.rb index 0f922f4e24b34f..0f97ac35d9124e 100644 --- a/test/io/wait/test_io_wait_uncommon.rb +++ b/test/io/wait/test_io_wait_uncommon.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true require 'test/unit' +require 'io/wait' # test uncommon device types to check portability problems # We may optimize IO#wait_*able for non-Linux kernels in the future @@ -74,4 +75,33 @@ def test_wait_readable_zero def test_wait_writable_null check_dev(IO::NULL, :wait_writable) end + + def test_after_ungetc_ready? + check_dev(IO::NULL, mode: "r") {|fp| + assert_respond_to fp, :ready? + fp.ungetc(?a) + assert_predicate fp, :ready? + } + end + + def test_after_ungetc_wait_readable + check_dev(IO::NULL, mode: "r") {|fp| + fp.ungetc(?a) + assert_predicate fp, :wait_readable + } + end + + def test_after_ungetc_in_text_ready? + check_dev(IO::NULL, mode: "rt") {|fp| + fp.ungetc(?a) + assert_predicate fp, :ready? + } + end + + def test_after_ungetc_in_text_wait_readable + check_dev(IO::NULL, mode: "rt") {|fp| + fp.ungetc(?a) + assert_predicate fp, :wait_readable + } + end end From 0f629083722a09f0b5a75040ca0511e71eb6032a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 29 Oct 2025 18:12:32 +0900 Subject: [PATCH 09/14] [ruby/date] Prefer `method_defined?` over `allocate.respond_to?` https://github.com/ruby/date/commit/fd8e3725f8 --- test/date/test_date_conv.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/date/test_date_conv.rb b/test/date/test_date_conv.rb index 772fbee9a4e6ce..c54a118f8ff0e4 100644 --- a/test/date/test_date_conv.rb +++ b/test/date/test_date_conv.rb @@ -82,7 +82,7 @@ def test_to_time__from_datetime assert_equal([1582, 10, 13, 1, 2, 3, 456789], [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec]) - if Time.allocate.respond_to?(:nsec) + if Time.method_defined?(:nsec) d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123.to_r/86400000000000 t = d.to_time.utc assert_equal([2004, 9, 19, 1, 2, 3, 456789123], @@ -91,7 +91,7 @@ def test_to_time__from_datetime # TruffleRuby does not support more than nanoseconds unless RUBY_ENGINE == 'truffleruby' - if Time.allocate.respond_to?(:subsec) + if Time.method_defined?(:subsec) d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123456789123.to_r/86400000000000000000000 t = d.to_time.utc assert_equal([2004, 9, 19, 1, 2, 3, Rational(456789123456789123,1000000000000000000)], From e49e0bb6c9b4ade9d8fb615a1f7cc65f9ea13a7f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 29 Oct 2025 18:40:25 +0900 Subject: [PATCH 10/14] [ruby/date] Remove archaic conditions `Time#nsec` and `Time#subsec` were both introduced in Ruby 1.9. https://github.com/ruby/date/commit/2c310d9f5c --- test/date/test_date_conv.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/date/test_date_conv.rb b/test/date/test_date_conv.rb index c54a118f8ff0e4..8d810844355956 100644 --- a/test/date/test_date_conv.rb +++ b/test/date/test_date_conv.rb @@ -82,21 +82,17 @@ def test_to_time__from_datetime assert_equal([1582, 10, 13, 1, 2, 3, 456789], [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec]) - if Time.method_defined?(:nsec) - d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123.to_r/86400000000000 - t = d.to_time.utc - assert_equal([2004, 9, 19, 1, 2, 3, 456789123], - [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.nsec]) - end + d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123.to_r/86400000000000 + t = d.to_time.utc + assert_equal([2004, 9, 19, 1, 2, 3, 456789123], + [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.nsec]) # TruffleRuby does not support more than nanoseconds unless RUBY_ENGINE == 'truffleruby' - if Time.method_defined?(:subsec) - d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123456789123.to_r/86400000000000000000000 - t = d.to_time.utc - assert_equal([2004, 9, 19, 1, 2, 3, Rational(456789123456789123,1000000000000000000)], - [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.subsec]) - end + d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123456789123.to_r/86400000000000000000000 + t = d.to_time.utc + assert_equal([2004, 9, 19, 1, 2, 3, Rational(456789123456789123,1000000000000000000)], + [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.subsec]) end end From 606abf2faba96e301e8f7445fc9fcc272cbf6b9e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 29 Oct 2025 19:41:51 +0900 Subject: [PATCH 11/14] Clean extension libraries copied for the namespace --- test/ruby/test_namespace.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_namespace.rb b/test/ruby/test_namespace.rb index bfbbe38e051ab2..6bc529b2811dd0 100644 --- a/test/ruby/test_namespace.rb +++ b/test/ruby/test_namespace.rb @@ -668,7 +668,9 @@ def test_prelude_gems_and_loaded_features_with_disable_gems end def test_root_and_main_methods - assert_separately([ENV_ENABLE_NAMESPACE], __FILE__, __LINE__, "#{<<~"begin;"}\n#{<<~'end;'}", ignore_stderr: true) + tmp = Dir.mktmpdir("namespace_so") + + assert_separately([{"TMPDIR"=>tmp, **ENV_ENABLE_NAMESPACE}], __FILE__, __LINE__, "#{<<~"begin;"}\n#{<<~'end;'}", ignore_stderr: true) begin; pend unless Namespace.respond_to?(:root) and Namespace.respond_to?(:main) # for RUBY_DEBUG > 0 @@ -690,5 +692,8 @@ def test_root_and_main_methods assert !$LOADED_FEATURES.include?("/tmp/barbaz") assert !Object.const_defined?(:FooClass) end; + ensure + File.unlink(*Dir.glob("_ruby_ns_*."+RbConfig::CONFIG["DLEXT"], base: tmp).map {|so| "#{tmp}/#{so}"}) + Dir.rmdir(tmp) end end From 2096ca8030f506b2f37d0c41796c5318e8a13126 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 22 Oct 2025 22:49:59 +0900 Subject: [PATCH 12/14] win32: Optimize `FIMETIME` calculations Assume that `FILETIME` and `ULARGE_INTEGER::u` are the same layout actually. --- win32/win32.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index c13c4e17320268..6db7fa60f48479 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4724,24 +4724,27 @@ waitpid(rb_pid_t pid, int *stat_loc, int options) #include +/* License: Ruby's */ +typedef union { + /* FILETIME and ULARGE_INTEGER::u are the same layout */ + FILETIME ft; + ULARGE_INTEGER i; +} FILETIME_INTEGER; + /* License: Ruby's */ /* split FILETIME value into UNIX time and sub-seconds in NT ticks */ static time_t filetime_split(const FILETIME* ft, long *subsec) { - ULARGE_INTEGER tmp; - unsigned LONG_LONG lt; const unsigned LONG_LONG subsec_unit = (unsigned LONG_LONG)10 * 1000 * 1000; - - tmp.LowPart = ft->dwLowDateTime; - tmp.HighPart = ft->dwHighDateTime; - lt = tmp.QuadPart; + FILETIME_INTEGER fi = {.ft = *ft}; + ULONGLONG lt = fi.i.QuadPart; /* lt is now 100-nanosec intervals since 1601/01/01 00:00:00 UTC, convert it into UNIX time (since 1970/01/01 00:00:00 UTC). the first leap second is at 1972/06/30, so we doesn't need to think about it. */ - lt -= (LONG_LONG)((1970-1601)*365.2425) * 24 * 60 * 60 * subsec_unit; + lt -= (ULONGLONG)((1970-1601)*365.2425) * 24 * 60 * 60 * subsec_unit; *subsec = (long)(lt % subsec_unit); return (time_t)(lt / subsec_unit); @@ -4762,15 +4765,6 @@ gettimeofday(struct timeval *tv, struct timezone *tz) } /* License: Ruby's */ -static FILETIME -filetimes_plus(FILETIME t1, FILETIME t2) -{ - ULARGE_INTEGER i1 = {.u = {.LowPart = t1.dwLowDateTime, .HighPart = t1.dwHighDateTime}}; - ULARGE_INTEGER i2 = {.u = {.LowPart = t2.dwLowDateTime, .HighPart = t2.dwHighDateTime}}; - ULARGE_INTEGER i = {.QuadPart = i1.QuadPart + i2.QuadPart}; - return (FILETIME){.dwLowDateTime = i.LowPart, .dwHighDateTime = i.HighPart}; -} - static void filetime_to_timespec(FILETIME ft, struct timespec *sp) { @@ -4800,11 +4794,11 @@ clock_gettime(clockid_t clock_id, struct timespec *sp) { LARGE_INTEGER freq; LARGE_INTEGER count; - if (!QueryPerformanceFrequency(&freq)) { + if (UNLIKELY(!QueryPerformanceFrequency(&freq))) { errno = map_errno(GetLastError()); return -1; } - if (!QueryPerformanceCounter(&count)) { + if (UNLIKELY(!QueryPerformanceCounter(&count))) { errno = map_errno(GetLastError()); return -1; } @@ -4818,19 +4812,20 @@ clock_gettime(clockid_t clock_id, struct timespec *sp) case CLOCK_PROCESS_CPUTIME_ID: case CLOCK_THREAD_CPUTIME_ID: { - FILETIME ct, et, kt, ut; + FILETIME_INTEGER c, e, k, u, total; BOOL ok; if (clock_id == CLOCK_PROCESS_CPUTIME_ID) { - ok = GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut); + ok = GetProcessTimes(GetCurrentProcess(), &c.ft, &e.ft, &k.ft, &u.ft); } else { - ok = GetThreadTimes(GetCurrentThread(), &ct, &et, &kt, &ut); + ok = GetThreadTimes(GetCurrentThread(), &c.ft, &e.ft, &k.ft, &u.ft); } - if (!ok) { + if (UNLIKELY(!ok)) { errno = map_errno(GetLastError()); return -1; } - filetime_to_timespec(filetimes_plus(kt, ut), sp); + total.i.QuadPart = k.i.QuadPart + u.i.QuadPart; + filetime_to_timespec(total.ft, sp); return 0; } default: From c90184828d5f5d627e185ede2433f556ebca1e8b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 22 Oct 2025 22:54:43 +0900 Subject: [PATCH 13/14] win32: Extract `FILETIME` related constants. --- win32/win32.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index 6db7fa60f48479..e7dfe2b065975a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4724,6 +4724,13 @@ waitpid(rb_pid_t pid, int *stat_loc, int options) #include +/* License: Ruby's */ +#define filetime_unit (10UL * 1000 * 1000) +#define filetime_diff_days ((1970-1601)*3652425UL/10000) +#define filetime_diff_secs (filetime_diff_days * (24ULL * 60 * 60)) +#define unix_to_filetime(sec) (((sec) + filetime_diff_secs) * filetime_unit) +#define filetime_unix_offset unix_to_filetime(0ULL) + /* License: Ruby's */ typedef union { /* FILETIME and ULARGE_INTEGER::u are the same layout */ @@ -4736,7 +4743,6 @@ typedef union { static time_t filetime_split(const FILETIME* ft, long *subsec) { - const unsigned LONG_LONG subsec_unit = (unsigned LONG_LONG)10 * 1000 * 1000; FILETIME_INTEGER fi = {.ft = *ft}; ULONGLONG lt = fi.i.QuadPart; @@ -4744,10 +4750,10 @@ filetime_split(const FILETIME* ft, long *subsec) convert it into UNIX time (since 1970/01/01 00:00:00 UTC). the first leap second is at 1972/06/30, so we doesn't need to think about it. */ - lt -= (ULONGLONG)((1970-1601)*365.2425) * 24 * 60 * 60 * subsec_unit; + lt -= unix_to_filetime(0); - *subsec = (long)(lt % subsec_unit); - return (time_t)(lt / subsec_unit); + *subsec = (long)(lt % filetime_unit); + return (time_t)(lt / filetime_unit); } /* License: Ruby's */ @@ -7593,7 +7599,7 @@ unixtime_to_filetime(time_t time, FILETIME *ft) { ULARGE_INTEGER tmp; - tmp.QuadPart = ((LONG_LONG)time + (LONG_LONG)((1970-1601)*365.2425) * 24 * 60 * 60) * 10 * 1000 * 1000; + tmp.QuadPart = unix_to_filetime((ULONGLONG)time); ft->dwLowDateTime = tmp.LowPart; ft->dwHighDateTime = tmp.HighPart; return 0; @@ -7606,7 +7612,7 @@ timespec_to_filetime(const struct timespec *ts, FILETIME *ft) { ULARGE_INTEGER tmp; - tmp.QuadPart = ((LONG_LONG)ts->tv_sec + (LONG_LONG)((1970-1601)*365.2425) * 24 * 60 * 60) * 10 * 1000 * 1000; + tmp.QuadPart = unix_to_filetime((ULONGLONG)ts->tv_sec); tmp.QuadPart += ts->tv_nsec / 100; ft->dwLowDateTime = tmp.LowPart; ft->dwHighDateTime = tmp.HighPart; From cee4a46c966200dda44c1d7de203a22629f95b03 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 29 Oct 2025 20:35:03 +0900 Subject: [PATCH 14/14] Use the given `TMPDIR` --- test/ruby/test_namespace.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/ruby/test_namespace.rb b/test/ruby/test_namespace.rb index 6bc529b2811dd0..5a014ad7148a51 100644 --- a/test/ruby/test_namespace.rb +++ b/test/ruby/test_namespace.rb @@ -668,9 +668,7 @@ def test_prelude_gems_and_loaded_features_with_disable_gems end def test_root_and_main_methods - tmp = Dir.mktmpdir("namespace_so") - - assert_separately([{"TMPDIR"=>tmp, **ENV_ENABLE_NAMESPACE}], __FILE__, __LINE__, "#{<<~"begin;"}\n#{<<~'end;'}", ignore_stderr: true) + assert_separately([ENV_ENABLE_NAMESPACE], __FILE__, __LINE__, "#{<<~"begin;"}\n#{<<~'end;'}", ignore_stderr: true) begin; pend unless Namespace.respond_to?(:root) and Namespace.respond_to?(:main) # for RUBY_DEBUG > 0 @@ -693,7 +691,8 @@ def test_root_and_main_methods assert !Object.const_defined?(:FooClass) end; ensure - File.unlink(*Dir.glob("_ruby_ns_*."+RbConfig::CONFIG["DLEXT"], base: tmp).map {|so| "#{tmp}/#{so}"}) - Dir.rmdir(tmp) + tmp = ENV["TMPDIR"] || ENV["TMP"] || Etc.systmpdir || "/tmp" + pat = "_ruby_ns_*."+RbConfig::CONFIG["DLEXT"] + File.unlink(*Dir.glob(pat, base: tmp).map {|so| "#{tmp}/#{so}"}) end end