Scratching an itch


and my first Ruby gem

I'm starting to love Ruby, mainly because it allows me to do what I like most about programming. Scratching personal itch it's a great thing, specially when it allows you to tackle boring repetitive  tasks. Ruby allows to do it fast, really quickly wrapping up a script that solves your problem, and then move on.

I just did that when facing the problem on having to create some sprites for a new website, I just didn't want to open GIMP and star fiddling around with layers, pixel, screen rulers and that kind of thing. So I just came up with an easy script that allowed me to create a png sprite based on a list of images, and also generates the CSS code to paste in my stylesheet (just because we can).

Since I thought somebody might find it useful, I packaged it as a gem and now is available in RubyGems, just:

gem install spritey

and run it with:

spritey -i foo.png,bar.png,baz.png -o name

and voila! I should note that I did the optparse part and the actual gem packaging really fast so expect (and please report) issues .

you can see and contribute code on the project repo

Post information
Posted by juanfgs 2015-05-07 16:35:54 +0000 UTC

Leave a Comment: