Skip to content

Commit 95ad4ce

Browse files
committed
Define to_path alias directly
The constant `TO_PATH` was defined for 1.9 compatibility but the code for it was dropped 10 years ago.
1 parent 27d3e64 commit 95ad4ce

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/pathname_builtin.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ class Pathname
195195

196196
# :stopdoc:
197197

198-
# to_path is implemented so Pathname objects are usable with File.open, etc.
199-
TO_PATH = :to_path
200-
201198
SAME_PATHS = if File::FNM_SYSCASE.nonzero?
202199
# Avoid #zero? here because #casecmp can return nil.
203200
proc {|a, b| a.casecmp(b) == 0}
@@ -264,7 +261,7 @@ def to_s
264261
end
265262

266263
# to_path is implemented so Pathname objects are usable with File.open, etc.
267-
alias_method TO_PATH, :to_s
264+
alias to_path to_s
268265

269266
def inspect # :nodoc:
270267
"#<#{self.class}:#{@path}>"

0 commit comments

Comments
 (0)