module SassC::Uri
def file_url_to_path(url)
def file_url_to_path(url) path = decode_uri_component(parse(url).path) if path.start_with?('/') windows_path = path[1..] path = windows_path if File.absolute_path?(windows_path) end path end
def file_urls_to_relative_path(url, from_url)
def file_urls_to_relative_path(url, from_url) decode_uri_component(file_urls_to_relative_url(url, from_url)) end
def file_urls_to_relative_url(url, from_url)
def file_urls_to_relative_url(url, from_url) parse(url).route_from(from_url).to_s end
def parse(...)
def parse(...) ::URI::RFC3986_PARSER.parse(...) end
def path_to_file_url(path)
def path_to_file_url(path) path = "/#{path}" unless path.start_with?('/') "file://#{encode_uri_path_component(path)}" end