Skip to content

Commit 31d07ee

Browse files
authored
Merge pull request #99 from ruby/skip-loading-gem-on-ruby-4
Skip loading gem implementation on Ruby 4.0+
2 parents 497e41f + 8b4d168 commit 31d07ee

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

lib/pathname.rb

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,12 @@
1010
# For documentation, see class Pathname.
1111
#
1212

13-
if defined?(::Pathname) # Clear builtin Pathname
14-
# :stopdoc:
15-
class ::Object
16-
remove_const :Pathname
17-
end
18-
19-
# Remove module_function Pathname
20-
class << ::Kernel
21-
undef Pathname
22-
end
23-
module ::Kernel
24-
undef Pathname
25-
end
13+
unless RUBY_VERSION >= '4'
14+
require 'pathname.so' if RUBY_ENGINE == 'ruby'
2615

27-
$".delete('pathname.so')
28-
# :startdoc:
16+
require_relative 'pathname_builtin'
2917
end
3018

31-
require 'pathname.so' if RUBY_ENGINE == 'ruby'
32-
33-
require_relative 'pathname_builtin'
34-
3519
class Pathname # * Find *
3620
#
3721
# Iterates over the directory tree in a depth first manner, yielding a

test/pathname/test_ractor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def setup
88
end
99

1010
def test_ractor_shareable
11+
omit "Ractor with Pathname is not supported on mingw" if /mingw/ =~ RUBY_PLATFORM
1112
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
1213
class Ractor
1314
alias value take

0 commit comments

Comments
 (0)