10 essential ruby gems

Tags
Tagsruby, programming, code, tips
Posted
Tue 8 Jan, 2008
Comments
7

There’s a few things I can’t live without when I’m programming. To that end, this is a list of 10 essential ruby gems that will make your life much easier, even if you only spend a small amount of time working with ruby.

Gems come and go, but these are keepers!

capistrano

Capistrano makes Rails application deployment less of a hassle. It’s also a clever framework for interacting with remote servers. I actually have backup scripts written with Capistrano, as an alternative to Rake/Net::SSH or shell scripts.

chronic

Chronic is a natural language time parser, with the added bonus of having a pun for its name.


>> Chronic.parse('3rd wednesday in november')
=> Wed Nov 19 12:00:00 0000 2008

ferret

Ferret will make your boss/clients/customers love you. It provides tools for fast text searching, and you can even index PDFs and Office documents. I’ve used Ferret on some pretty big sites, and my clients all said “wow this is just like Google!”

hpricot

hpricot is a fast and easy HTML parser. If you find yourself needing to extract content out of HTML or even XML, hpricot is one of the easiest ways to do it. I actually use it for a few things in Helipad

rcov

rcov is one of the reasons you don’t see our applications crashing too often. It analyses your source code, and highlights sections missing from your tests. It’s fast, doesn’t get in the way, and helps reduce headaches.

scruffy

I’ve used Gruff for graphing, and while it’s very good, I prefer the design of scruffy’s API. The way it works is pretty ingenious: simple XML is generated to drive SVG graphs. Since SVG provides a way to work intuitively with image primitives, a lot of messy image magick code is just thrown away.

I’ve quite liberally inherited and overridden stuff in scruffy to create all kinds of clever graphs, so give it a try if you’re feeling a bit stuck with your current graphing library.

simple-rss

simple-rss parses RSS and atom feeds, does a good job of it and does it quickly. Its parser is easy to extend too, so you should be able to tame invalid or proprietary feeds.

thin

Thin uses EventMachine, Rack, and Mongrel to create a very fast web server. I use it for my local Rails development, and it’s slightly faster than mongrel. To use it with my Rails app I just type thin start in my app’s directory. At the moment I’m having problems with thin and IE cookies, so it’s worth remembering that if you run into the same problem and think your app might be at fault. (Note: This now seems to be fixed with 0.6.1 and Rails 2.)

To get thin, gem install thin.

turn

Turn makes your Test::Unit output easier to read. Turn might not seem like much, but it really helps me read my tests. I rely heavily on tests for maintaining Helicoid’s applications, so anything that helps make the process more intuitive is welcome.

To get turn, gem install turn.

wirble

wirble makes irb easier to use. You get better history support (between sessions) and colour, so your eyes and fingers do less work in the long run.


Bob

Jan 8

They have very silly names.

Alex

Jan 8

They're all silly and/or cute, especially ferret. Incredibly I used to forget them quite often, having to pull out gem search quite a bit (which has a sensible name)

Tamer Salama

Jan 29

I remember using SVG:Graph for a previous project. It looks (out of thebox) more professional than Scruffy and Gruff. It also has Timeseries and Schedule types (which as I remember weren't in the other gems).

http://www.germane-software.com/software/SVG/SVG::Graph/

macournoyer

Jan 30

hey glad you like thin!

What's the problem w/ IE and cookies?

giles bowkett

Jan 30

I feel like a hooker for doing this, but Utility Belt incorporates Wirble and gives you the best IRB command history currently available (courtesy of Ben Bleything).

(The hooker factor comes in because UB is my gem.)

Don

Jan 31

You're no hooker, I love Utility Belt! If you like wirble, it's a no-brainer that you'll love ub.

Alex

Jan 31

Thanks for the comments everyone!

macournoyer: I'll try and reproduce it and send you more details. I did switch to mongrel_rails during my IE testing session and it was OK, so I assumed it was thin's fault.

Security Code