Sunday, January 31, 2016

Gem SaneTitle: the first fruit



I posted an article here yesterday asking for suggestions about Ruby gems people would consider useful, specially when using Rails.

This morning I received an e-mail, unfortunately unsigned, with the first suggestion: a gem to receive a string and use it to generate a sane file name to be used in a URL.

This is exactly what happens here at Blogger, when you post an article. This article, for instance, is called "Gem SaneTitle: the first fruit" and it will be saved as gem-sanetitle-first-fruit.html. All in lower case; special chars removed, only letters and numbers remaining; no spaces, all of them replaced with hyphens.

As a result of this suggestion, here is the first fruit of this effort to create useful gems: SaneTitle.




The gem is quite simple and I'd be pleased if people could improve it. It's there at GitHub, it is open-source and you just need to fork it and code. Or post suggestions and issues at the GitHub page.

By the way, my GitHub area (https://github.com/EdDeAlmeidaJr) has many interesting projects and I'd love to receive suggestions or improvements on them. Feel free to follow and fork whatever you want.