# File lib/core_ext/uri.rb, line 10deffrom_path(path:, fragment:nil, scheme:"file")
# On Windows, if the path begins with the disk name, we need to add a leading slash to make it a valid URIescaped_path = if/^[A-Z]:/i.match?(path)
DEFAULT_PARSER.escape("/#{path}")
elseDEFAULT_PARSER.escape(path)
endbuild(scheme:scheme, path:escaped_path, fragment:fragment)
end
Public Instance Methods
to_standardized_path()
# File lib/core_ext/uri.rb, line 25defto_standardized_pathparsed_path = pathreturnunlessparsed_pathunescaped_path = DEFAULT_PARSER.unescape(parsed_path)
# On Windows, when we're getting the file system path back from the URI, we need to remove the leading forward# slashif%r{^/[A-Z]:}i.match?(unescaped_path)
unescaped_path.delete_prefix("/")
elseunescaped_pathendend