[Rubygems-developers] Hook required for update --system

Eric Hodel drbrain at segment7.net
Fri Sep 12 19:45:37 EDT 2008

On Aug 17, 2008, at 15:01 PM, Neil Wilson wrote:

> As you know I've been working on some new packaging for Ubuntu using
> the new operating_system.rb facilities.
> One of the things I want to do is override the 'update --system'
> facility so that it calls the native package manager rather than
> trying to do it via gems. An update via gems always goes into the
> wrong directory, and it would upset the native package manager anyway.
> I couldn't see an easy way of changing the facility so I had to patch
> the update command so that it simply execs the correct package manager
> command.
> Would it be possible to factor out the default behaviour of adding
> 'rubygems-update' to the list of gems to update so that it can be
> overridden in 'operating_system.rb'?

Right now this is all in Gem::Commands::UpdateCommand#do_rubygems_update

I'm trying to think of a solution that would make it easy to define  
your own, but I've not arrived at one.

Opening the class and defining it ahead of time could cause the rest  
of UpdateCommand not to load.  Requiring the file first causes lots of  
extra stuff you don't want to load.

More information about the Rubygems-developers mailing list