Faster RubyGem deploys thanks to Jeremy Kemper

27 Jun 2008

A long while back Jeremy Kemper did up some nice rewrite rules for RubyForge. The idea was that the filenames of new gems will be tracked and RubyForge will serve those gems locally rather than redirecting the request out to the mirrors. After a long delay (sorry!) I finally implemented the PHP side of things - e.g., modified the GForge code to write out the filename when a gem is released.

So today, for example, Jamis Buck released Capistrano 2.4.1 at 1:26. The "new gem check" cronjob ran at 1:40 and placed the gem file in the main gems directory, and the index was rebuilt by around 1:47. And at 1:48, what should appear in the gems.rubyforge.org virtual host log:

gems.rubyforge.org 213.119.94.76 - - [27/Jun/2008:13:48:11 -0400] "GET /gems/capistrano-2.4.1.gem HTTP/1.1" 200 109056 "-" "RubyGems/1.0.1 universal-darwin-9"

Huzzah! The gem is being served without waiting for all the mirrors to be updated. Now I just need to write a little code (update 6/29, done) to remove file names from the list after 24 hours or so; by that time the gem will have been sync'd out.

So, to summarize, gems will now be available very soon after they're released. Thanks Jeremy!