[DOC] Document constants in Pathname

This commit is contained in:
Peter Zhu 2025-08-26 10:01:00 -04:00
parent 1928df4d33
commit da6198de8f

View File

@ -311,7 +311,9 @@ class Pathname
end
if File::ALT_SEPARATOR
# Separator list string.
SEPARATOR_LIST = "#{Regexp.quote File::ALT_SEPARATOR}#{Regexp.quote File::SEPARATOR}"
# Regexp that matches a separator.
SEPARATOR_PAT = /[#{SEPARATOR_LIST}]/
else
SEPARATOR_LIST = "#{Regexp.quote File::SEPARATOR}"
@ -319,6 +321,7 @@ class Pathname
end
if File.dirname('A:') == 'A:.' # DOSish drive letter
# Regexp that matches an absoltute path.
ABSOLUTE_PATH = /\A(?:[A-Za-z]:|#{SEPARATOR_PAT})/
else
ABSOLUTE_PATH = /\A#{SEPARATOR_PAT}/