-
Notifications
You must be signed in to change notification settings - Fork 1
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
No part of a URL should be nil #78
Conversation
close #52 Only added test for #trd since all other methods are tested in the "when given bad input" context.
This shouldn't have been committed :P
@@ -38,6 +38,8 @@ def internal_parse(potential_url) | |||
public_suffix_domain = PublicSuffix.parse(addressable_uri.display_uri.host) | |||
raise Twingly::URL::Error::ParseError if public_suffix_domain.nil? | |||
|
|||
raise Twingly::URL::Error::ParseError unless public_suffix_domain.sld |
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.
Follow suit with the if just above (change to if nil). :)
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.
👍 Didn't notice that
I think I like this part.
Not so sure about this part, one interpretation of nil is "it doesn't exist", where |
My thought was that since |
Yeah, and it might make sense here too. I think the calls to |
I don't like them either, but at least its clear what is returned :) |
Does any of the urls added in the |
No. I'm not sure how to test those methods with invalid urls since a
|
👍 |
As pointed out by @walro >> Added .to_s to all getter methods (#scheme, #trd, etc.) > Does any of the urls added in the url_spec exercise this? Just looking the code it seems like the check for sld would pick them all up. Let's try without the #to_s until we an counter-example.
Should this be released as a patch version? I think it should, but the |
I think we are already in for a new major, with the other changes that have been made in master (the private methods stuff).
|
Agree it should be a patch, but since we know it's a breaking change I think it's better to bump the major version. We didn't specify in any documentation that |
If we first returned |
Wasn't aware of that.
Thats true, a new major version it is then :) |
An attempt to fix #52
sld
now results in aNullURL
. (Im not sure whether my assumption here is correct, but it works for the URLs given as examples in domain, sld, trd (maybe others) can be nil #52).to_s
to#trd