3 ms·
Why is this a gem? It's two view helpers and like 30 lines of Ruby code, if that. I've solved this problem the same way probably 5 times in rails apps and it's
by alttab 9y ago
Why is this a gem? It's two view helpers and like 30 lines of Ruby code, if that.
I've solved this problem the same way probably 5 times in rails apps and it's super easy to build this interface in yourself without taking on another dependency
- kawsper 9y agoI originally built it as a gem because the company I worked at used it across several projects, I almost think it was my first Ruby gem back in 2013. I also hoped others would find it useful, and they did! The people from Semaphore showed interest in maintaining my 30 lines of Ruby code, and now they even wrote a blogpost about it :)
- gnaritas 9y ago> Why is this a gem? > I've solved this problem the same way probably 5 times in rails apps Because gems avoid such code duplication, they're the correct way to "share" code between projects rather than reinventing the solution each time you need it.
- matthewmacleod 9y agoI've solved this problem the same way probably 5 times in rails apps You've just answered your own question :) There is a trade-off, like always. You've solved this problem 5 times, sure – but maybe each of those 5 times you've dome something slightly different. Or maybe you fix a bug with an edge case, and that bug fix doesn't get incorporated into other projects. There are downsides. On the other hand, a dependency removes some simple code from your control. I don't think anybody in the Ruby community wishes to end up with the silliness of e.g. `isNAN` from Node.