microformats-ruby icon indicating copy to clipboard operation
microformats-ruby copied to clipboard

Implement sophisticated url normalization

Open jlsuttles opened this issue 12 years ago • 9 comments
trafficstars

php-mf2 tests are comprehensive https://github.com/indieweb/php-mf2/blob/master/tests/Mf2/URLTest.php

jlsuttles avatar Nov 04 '13 23:11 jlsuttles

I think this should be created at a standalone gem that this gem then depends on.

veganstraightedge avatar May 05 '17 18:05 veganstraightedge

@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.

veganstraightedge avatar May 11 '17 17:05 veganstraightedge

Hmm this gem might already do it: https://github.com/sporkmonger/addressable Take a look at the "join" method.

aaronpk avatar May 11 '17 17:05 aaronpk

For reference, @aaronpk is talking about this method.

https://github.com/sporkmonger/addressable/blob/8f4fee07243af0b788c625e59a9ca529489336d6/lib/addressable/uri.rb#L306

veganstraightedge avatar May 11 '17 22:05 veganstraightedge

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.

veganstraightedge avatar May 11 '17 22:05 veganstraightedge

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.

jgarber623 avatar Jul 05 '18 20:07 jgarber623

…and done! Absolutely v1.1.0 adds tests from the php-mf2 URL test suite.

jgarber623 avatar Jul 05 '18 21:07 jgarber623

@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 avatar Jul 05 '18 21:07 veganstraightedge

@veganstraightedge Good catch. Thanks!

jgarber623 avatar Jul 06 '18 01:07 jgarber623