There has been some turmoil in the Ruby community over the github decision to stop building gems.

Since I have a forked gem that was previously hosted on github, I and my fellow users of the fork are directly affected.

In my case, I am going to do the simplest thing that could possibly work. Move my existing published gem under the same name1 (leshill-will_paginate) over to Gemcutter. Why not follow along?

Before getting started, I signed up with Gemcutter (go ahead, do so now). Once you have confirmed your account, follow the very clear instructions and add your API key to ~/.gemrc.

gemcutter_key: NOT_MY_REAL_API_KEY

Gemcutter runs as a plugin to RubyGems, so lets install and configure it.

sudo gem install gemcutter
gem tumble

Great! We are ready to start publishing. Gemcutter only accepts prebuilt gems, so we will have to build our gem locally first. Before doing that I will modify the gemspec to make it clear that this is a fork by changing the name2 and a few other fields.

Gem::Specification.new do |s|
  s.name    = 'leshill-will_paginate'
  s.version = '2.3.11'
  s.date    = '2009-10-11'
  s.summary = "Fork of the Most awesome pagination solution for Rails"
  s.description = "The will_paginate library provides a simple, yet powerful and extensible API for ActiveRecord pagination and rendering of pagination links in ActionView templates."
  s.authors  = ['Les Hill', 'Mislav Marohnić', 'PJ Hyett']
  s.email    = 'someone@example.com'
  s.homepage = 'http://github.com/leshill/will_paginate'

Ok, now we can build it.

gem build will_paginate.gemspec

Ready? Let’s push it up to Gemcutter

gem push leshill-will_paginate-2.3.11.gem

We can now install my fork of will_paginate:

sudo gem install leshill-will_paginate

Done!

1 This is one source of heat (of many?) in the current ‘What to do?’ gem discussion. Who knew we were all unhappy with the github decision to publish gems as user-gemname?

2 github prepended the github user automatically, now we have to do so explicitly in the gemspec.

blog comments powered by Disqus