3 ms·
If anyone's interested, I ported this into a Ruby Gem a couple of years back. I haven't given it too much love lately, but it should still be good/useful: http:
by anathema 17y ago
If anyone's interested, I ported this into a Ruby Gem a couple of years back. I haven't given it too much love lately, but it should still be good/useful: http://github.com/jurisgalang/snapurl http://github.com/jurisgalang/snapurl
- sailormoon 17y agoThis is probably the wrong forum but there is a mistake in the regex in the makeFilename method. In trying to detect https it will strip the first letter of any domain starting with s. Check it out: >> name = 'http://super.com/' => "http://super.com/" >> name.gsub!(/\W/, '') => "httpsupercom" >> name.gsub!(/^http(s)?/i, '') => "upercom" Cool, though ; )