puppetlabs/puppetlabs-ruby — pull request #1 by crayfishx (2012-07-12 21:54:07+00:00)
Title: Added functionality for rubygems and ruby versioning

This pull request is an attempt at managing ruby gems versions (as well as ruby itself, which is trivial)

The problem
-------------------

Some distros, in particular Redhat derivatives have very old versions of Rubygems (CentOS is shipped with 1.6!) Quite a few gems these days require >= 1.8 and therefore things like Razor on CentOS 6.0 will fail out of the box. Whilst just requiring a newer package is an option for some people, the general method for upgrading Rubygems in the ruby world is with gems itself....

```
$ get update --system
```

The problem with this is it defaults to the latest version of gems and takes no parameters for versioning which isn't going to be suitable for a lot of production systems, so the general method used in the community seems to be to install the rubygems-update gem of the version that you want and run update_rubygems

```
$ gem -v
1.3.7

$ gem install -v1.8.5 rubygems-update
$ update_rubygems
$ gem -v
1.8.5
$ rpm -qa |grep gems
rubygems-1.3.7-1.el6.noarch
```

Ruby Module
------------------

This pull request is my first stab at enabling the above functionality to be driven from puppet.... More details are in the manifest/init.pp documentation

* Optional package or rubygems versioning of rubygems itself
* Ruby version parameter
* Ruby package name parameter
* Added spec tests
* Added Rakefile and README