[Rubygems-developers] Working on a fork of a ruby gem - installing gems in a special way

Ryan Davis ryand-ruby at zenspider.com
Wed May 27 02:42:21 EDT 2009

On May 25, 2009, at 04:23 , Vladimir Dobriakov wrote:

> I've tried following approaches. All of them are either cumbersome or
> error prone or both:
> ## Repeatedly reinstall
> 1. uninstall the current gem version `sudo gem uninstall foo`
> 2. switch to my version `cd myversion_of_foo`
> 3. edit the source code (apply the changes)
> 4. create a gem from my sources `rake gem`
> 5. install my version of the gem `sudo gem install pkg/foo-1.0.0.gem`
> 6. try out in connection with my (bigger) project
> 7. repeat all the steps for each change
> OK, one should work on a feature in a test-driven way and in
> isolation, which should reduce the amount of install/uninstall
> iterations, but still ...

I start with modifying $: on the dependent side to do the quickest  
back and forth. Once I have that flushed out, I update the version  
number on the dependency and `rake install_gem` (assuming it is a hoe  
empowered gem) and clean up any hacks I've put in on the dependent side.

When I'm working with student's code and I don't want to install a  
dependency, I'll frequently `gem fetch; gem unpack` it and then `mv  
gem-1.0.0/lib/* lib`. Totally cheating, I know, but it works fine for  
throwaway stuff.

More information about the Rubygems-developers mailing list