Building ruby projects with newgem

Over the weekend I was working on revamping a whole set of older ruby projects, some having to do with my Proliphix Thermostat.  I had this crufty Rakefile from the icalendar project that I’d been copying and modifying for new projects, and it was slowly degrading.  I thought that there had to be a better way.  There is, it’s called newgem.

Newgem is like h2xs in the Perl world, something to stub out a new module with all the right files and structures.  But, as the Ruby folks tend to do, it ups the ante in the process.  In addition to the basic build, packaging, testing, and coverage results you’d expect, you also get a targets for: creating you rubyforge website, publishing your gems to rubyforge and gemcutter, posting release announcements on rubyforge, and even posting blog posts about your release (though I haven’t configured that one yet).

The release cycle is now:

rake release
rake website
rake post_news

The Rakefile created is loading these features from base modules, so it’s only ~ 30 lines, a heck of a lot easier to maintain than the 300 line Rakefiles I had which provided about 1/2 these features inline.

If you are doing Ruby development, you should really check out newgem.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s