diff --git a/lib/pathname.rb b/lib/pathname.rb index 37a5a21..84feeb7 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -10,28 +10,14 @@ # For documentation, see class Pathname. # -if defined?(::Pathname) # Clear builtin Pathname - # :stopdoc: - class ::Object - remove_const :Pathname - end +return if RUBY_VERSION >= '4.1' - # 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