diff --git a/Project.toml b/Project.toml index bb90d65..b994a4f 100644 --- a/Project.toml +++ b/Project.toml @@ -10,7 +10,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" URIParser = "30578b45-9adc-5946-b283-645ec420af67" [compat] -FilePathsBase = "0.5" +FilePathsBase = "0.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/uri.jl b/src/uri.jl index e46506d..40982ab 100644 --- a/src/uri.jl +++ b/src/uri.jl @@ -1,19 +1,19 @@ function URIParser.URI(p::AbstractPath; query="", fragment="") - if isempty(root(p)) + if isempty(p.root) throw(ArgumentError("$p is not an absolute path")) end b = IOBuffer() print(b, "file://") - if !isempty(drive(p)) + if !isempty(p.drive) print(b, "/") - print(b, drive(p)) + print(b, p.drive) end - for i=2:length(p.parts) + for s in p.segments print(b, "/") - print(b, URIParser.escape(p.parts[i])) + print(b, URIParser.escape(s)) end return URIParser.URI(URIParser.URI(String(take!(b))); query=query, fragment=fragment)