[LRUG] Ruby and URLs

Kenneth Lee kenfodder at gmail.com
Tue Apr 13 04:38:13 PDT 2010


Hi Guys,

Quite a few projects I've worked on I've had to convert URLs with flat 
text to links in HTML. But every time the implementation feels 
inadequate with some ridiculous regex that isn't bundled with a spec to 
test against.

Is there a Gem or library that will allow me to do this easily and in a 
reusable way. If so I will go into banana dance mode!

Ideally I want to simply gem install something, then in simply do 
linkify(sometext) possible with a block to customize the replacement for 
html classes etc... and some config or options to say whether the 
http(s) part must exist, must have this set of subdomains, must not be a 
top-level, all these fancy options to correctly match it.

I'm getting this itch to write a library like this but surely it's done?!

Cheers,

Ken



More information about the Chat mailing list