Note To Self: How To Build Gems

Update (18 October): things have changed.

~~~~~~~~

This topic has come up quite a bit recently. I’d never really thought about it much before — I just used Jeweler because that’s what GitHub recommended. However I had been noticing that Jeweler made what should have been a simple task complicated. And it decimated the signal to noise ratio of my commits: my “real” commits were swamped by ones Jeweler made to update the version number and so on.

So after looking into the matter briefly, here’s what I now think.

The gemspec DSL is nice and clean. Don’t hide it behind something like Jeweler.

We need to:

  • build versioned gems
  • build versioned archives (.tar.gz)
  • tag the versions in Git / on GitHub
  • push the versioned gems to rubygems.org
  • (optional) install versioned gems locally

We can do all this by hand; it’s pretty simple. We can also save typing with Rake.

Either DIY:

Or using a simple tool like minimal gem (mg):

Andrew Stewart • 18 May 2010 •

Got a question or comment? or .