diff --git a/lib/pathname.rb b/lib/pathname.rb index 37a5a21..18c2e04 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -10,28 +10,12 @@ # For documentation, see class Pathname. # -if defined?(::Pathname) # Clear builtin Pathname - # :stopdoc: - class ::Object - remove_const :Pathname - end - - # Remove module_function Pathname - class << ::Kernel - undef Pathname - end - module ::Kernel - undef Pathname - end +unless RUBY_VERSION >= '4' + require 'pathname.so' if RUBY_ENGINE == 'ruby' - $".delete('pathname.so') - # :startdoc: + require_relative 'pathname_builtin' end -require 'pathname.so' if RUBY_ENGINE == 'ruby' - -require_relative 'pathname_builtin' - class Pathname # * Find * # # Iterates over the directory tree in a depth first manner, yielding a diff --git a/test/pathname/test_ractor.rb b/test/pathname/test_ractor.rb index 737e4a4..ed1403e 100644 --- a/test/pathname/test_ractor.rb +++ b/test/pathname/test_ractor.rb @@ -8,6 +8,7 @@ def setup end def test_ractor_shareable + omit "Ractor with Pathname is not supported on mingw" if /mingw/ =~ RUBY_PLATFORM assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") class Ractor alias value take