microformats-ruby
microformats-ruby copied to clipboard
Implement sophisticated url normalization
php-mf2 tests are comprehensive https://github.com/indieweb/php-mf2/blob/master/tests/Mf2/URLTest.php
I think this should be created at a standalone gem that this gem then depends on.
@aaronpk said he'd take this on and would build it as a stand alone gem.
This gem would then need to depend upon and use it.
Hmm this gem might already do it: https://github.com/sporkmonger/addressable Take a look at the "join" method.
For reference, @aaronpk is talking about this method.
https://github.com/sporkmonger/addressable/blob/8f4fee07243af0b788c625e59a9ca529489336d6/lib/addressable/uri.rb#L306
At quick glance, seems good.
I'll leave it up to implementors to decide whether to use that or create a new gem (if addressable) ends up to be insufficient.
I've just recently abstracted some similarly duplicative code from my own projects into the Absolutely gem which relies on Addressable under-the-hood.
I'll add some more test cases from @aaronpk's aforelinked php-mf2 test suite for completeness.
…and done! Absolutely v1.1.0 adds tests from the php-mf2 URL test suite.
@jgarber623 You have the Absolutely repo tagged absolute-ur. Maybe you meant absolute-ur?
https://github.com/topics/absolute-ur
vs
https://github.com/topics/absolute-url
@veganstraightedge Good catch. Thanks!