Gem in a Box 08 January 2010

screen shot

Background

At work we have several in house gems we use. We don't want to make them public to the internet, but we do want to share them between the developers, and the QA boxes.

We were using make-gem-now, but that was always a little messy, and not in keeping with current best practices.

So a new plan formed, we need an internal gemcutter.com, which is very doable.

So I started looking into it, and then I realised that we would all have to have ownership of the gems, and maintain that at all times… basically it was a bad fit for us as we do not need authentication, Amazon S3 or any of that bollocks.

Features:

  • upload a gems…
    • via command line.
    • via web interface
  • replace a gems.
  • delete a gems.
  • install gems like any other source.
  • list the available gems.

Implementation

A small sinatra app borrowing heavily from both make-gem-now and gemcutter.

Server Usage:

$ gem install geminabox

Create a config.ru as follows:

require "rubygems"
require "geminabox"

Geminabox.data = "/var/geminabox-data" # …or wherever
run Geminabox

And finally, hook up the config.ru as you normally would (passenger, thin, unicorn, whatever floats you boat).

Client Usage

$ gem install geminabox
$ gem inabox pkg/my-awesome-gem-1.0.gem