summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-05-02 16:36:09 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2026-05-13 17:37:48 +0900
commitb0b7a943e84e6bede60ebaec74c838ccb3cb6b7f (patch)
treefaeb3917096a3c23a4b7ee3d3a2ca1e53b6f6cda
parentf3dd724da56ce61024781c6868577aaa79218412 (diff)
pathname: Remove dead code
pathname_builtin.rb no longer synchronize from ruby/pathname.
-rw-r--r--pathname_builtin.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/pathname_builtin.rb b/pathname_builtin.rb
index d3da315872..5965cb2830 100644
--- a/pathname_builtin.rb
+++ b/pathname_builtin.rb
@@ -282,14 +282,6 @@ class Pathname
alias === ==
alias eql? ==
- unless method_defined?(:<=>, false)
- # Provides for comparing pathnames, case-sensitively.
- def <=>(other)
- return nil unless Pathname === other
- @path.tr('/', "\0") <=> other.path.tr('/', "\0")
- end
- end
-
def hash # :nodoc:
@path.hash
end
@@ -306,27 +298,6 @@ class Pathname
"#<#{self.class}:#{@path}>"
end
- unless method_defined?(:sub, false)
- # Return a pathname which is substituted by String#sub.
- def sub(pattern, *args, **kwargs, &block)
- if block
- path = @path.sub(pattern, *args, **kwargs) {|*sub_args|
- begin
- old = Thread.current[:pathname_sub_matchdata]
- Thread.current[:pathname_sub_matchdata] = $~
- eval("$~ = Thread.current[:pathname_sub_matchdata]", block.binding)
- ensure
- Thread.current[:pathname_sub_matchdata] = old
- end
- yield(*sub_args)
- }
- else
- path = @path.sub(pattern, *args, **kwargs)
- end
- self.class.new(path)
- end
- end
-
# Return a pathname with +repl+ added as a suffix to the basename.
#
# If self has no extension part, +repl+ is appended.