We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8c2210 commit a15c1f5Copy full SHA for a15c1f5
1 file changed
lib/pathname.rb
@@ -252,10 +252,12 @@ def ==(other)
252
alias === ==
253
alias eql? ==
254
255
- # Provides for comparing pathnames, case-sensitively.
256
- def <=>(other)
257
- return nil unless Pathname === other
258
- @path.tr('/', "\0") <=> other.to_s.tr('/', "\0")
+ unless method_defined?(:<=>)
+ # Provides for comparing pathnames, case-sensitively.
+ def <=>(other)
+ return nil unless Pathname === other
259
+ @path.tr('/', "\0") <=> other.to_s.tr('/', "\0")
260
+ end
261
end
262
263
def hash # :nodoc:
0 commit comments