Patching Rubies
As a side effect of RVM it is very easy to test patches with many versions of ruby.
Installing specific rubies with custom ruby source patches
$ rvm install 1.8.6 --patch /path/to/awesome.patch
Alternatively you can specify more than one patch, they are applied in the order given.
$ rvm install 1.8.6 --patch /path/to/awesome.patch,/path/to/another.patch
Contributing patches
Testing patches
Functionality improvements
Test ruby before patching
$ rvm install 1.8.7 $ ruby your_test.rb #or $ ruby -e "puts 'your one line test'"
Uninstall previous version before installing with patch
$ rvm remove 1.8.7
Test ruby after patching
$ rvm install 1.8.7 --patch /path/to/awesome.patch $ ruby your_test.rb #or $ ruby -e "puts 'your one line test'"
Compilation errors
Test ruby after patching
$ rvm install 1.8.6 --patch /path/to/compilation.patch $ ruby -v
Contributing patches
If your patch fixes important issues on old branches like 1.8.6 it can be contributed to RVM. But first talk with somebody, before you start preparing your contribution check out what other think about it, some changes aren't right for everybody and shouldn't be contributed. Best way is to use IRC and ask a questions about your patch.
It might appear that your patch is to awesome for everybody and you should keep it as your own vendor extension vendor/ruby-patches/my-awesome.patch , and always use --patch option.
To start you need to fork wayneeseguin/rvm clone your fork to disk, and add your patch to right directory like: patches/ruby/1.8.6/
Install your version of RVM into system
Backup original RVM installation
$ mv $HOME/.rvm $HOME/.rvm-backup
Install extended RVM (from your checked out fork directory)
$ ./install
Install ruby which should be automatically patched, test as needed
$ rvm install 1.8.7 $ ruby -v #or $ ruby your_test.rb #or $ ruby -e "puts 'your one line test'"
remove test rvm installation, restore backup
$ rm -rf $HOME/.rvm $ mv $HOME/.rvm-backup $HOME/.rvm
When the code is ready and tested:
- Commit your code, don't miss a thing.
- push changes to github.
- order a pull request