Skip to content

Commit af973b0

Browse files
committed
Remove built-in Pathname
1 parent 2b63d44 commit af973b0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/pathname.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@
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
26+
27+
$".delete('pathname.so')
28+
# :startdoc:
29+
end
30+
1331
require 'pathname.so'
1432

1533
class Pathname

0 commit comments

Comments
 (0)