-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
joinpath & allow kwargs in constructor #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nice, thanks.
My only thought is that we should perhaps follow the lead of joinpath
for posix paths, in terms of handling absolute path components.
@c42f bump |
PS. can we have a new tag after this gets merged? I kinda want to release my package with this new interface directly instead of updating later... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS. can we have a new tag after this gets merged?
Yes! Please bump to 1.1.0 :-)
if isempty(uri.path) | ||
path = "/" * path | ||
end | ||
return URI(uri; path=normpath(path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather avoid normpath
as that uses system-dependent regexes to parse the path (including drive letters and such, on windows).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow the exact rules in RFC1808 section 4 I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this normpath
calls the URLs.normpath
: https://github.com/JuliaWeb/URIs.jl/blob/master/src/URIs.jl#L415 which follows https://tools.ietf.org/html/rfc3986#section-5.2.4 already @c42f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh dear, yes indeed!
This is what happens when trying to maintain a package I seem to have inherited by accident 😆
Co-authored-by: Chris Foster <chris42f@gmail.com>
Thanks, this is very nice. I'm sure it will be useful. |
New version: JuliaRegistries/General#25219 |
@c42f I implemented the
joinpath
andURI
mentioned in #10