Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

How Dr Nic Packages His Ruby Code With RubyGems

By Peter Cooper / December 5, 2008

Picture 3.pngEveryone's favorite Australian Ruby developer, Dr. Nic Williams, has put together a handy slide presentation called How to Package Your Ruby Code where he demonstrates how he packages his various bits of Ruby code using RubyGems. His process is backed by his own NewGem, a library that generates a framework for a new Ruby gem, and Hoe by Ryan Davis.

In his explanatory blog post, Nic also ponders Perl's CPAN (a gigantic archive of Perl modules) and the module installation process it offers. When you install a module, the tests for the module are run in real time immediately. If they fail, the module isn't installed into its final location. Nic discovered you can do this with RubyGems by adding the --test option, but it would be nice if it were a standard operation as it could clear up ambiguity over whether a library is fully functioning or not before you try to use it.

If you want to see a different approach, Ryan Bates has recorded a "how to make a gem" screencast.

Elsewhere, Dr Nic was recently interviewed on the Mobile Orchard podcast. Mobile Orchard is essentially the Ruby Inside of the iPhone developer world, and Nic spoke about getting Ruby onto the iPhone, unit testing Objective C from Ruby, and other great stuff.

Supported by: ActionGear is a menu-bar app for task management on your Mac. It's lightweight, quick, and helps you get stuff done. Try it out for free.

Comments

  1. Joe Schmoe says:

    He's not *my* favourite Australian developer.

  2. Peter Cooper says:

    Who's yours? :)

  3. Daniel Berger says:

    Part of the reason rubygems doesn't force --test is the fact that Test::Unit 1.x doesn't support the ability to ignore or skip tests (thought version 2.x does). As a result, several developers don't worry if some of their tests fail, when they should just be ignored. The upshot is that developers will simply resort to --force installs because the test suites themselves aren't well handled.

    The other part is that I don't think Eric wants it to be the default, but you'd have to ask him. I have a vague recollection of this coming up once before a long time ago.

  4. Daniel Berger says:

    Another issue for users of test frameworks that aren't part of the stdlib (rspec, shoulda, etc) is that they may not have included them as a required dependency in their gemspec since successful test runs aren't required by default prior to installation anyway.

    There will be some lag there as authors catch up.

  5. Gregory Brown says:

    @Peter,

    Dr. Nic is great, but my favorite Australian developer is James Healy.
    http://github.com/yob

    Since he is a Prawn / Ruport developer, I guess I have a strong bias. :)

  6. tuoker says:

    I like newgems very much

Other Posts to Enjoy

Twitter Mentions