puppetlabs/puppetlabs-ruby — pull request #40 by Aethylred (2014-08-04 04:17:24+00:00)
Title: Update package rules for Ubuntu and Debian

The package selection rules for Ubuntu and Debian were not right, this overhauls them and sorts them out.

* Update package logic for Debian and different Ubuntu releases
* Allows specifying different ruby and rubygems packages
* Posts warnings if a specific Ruby version can't be satisfied from the default repositories
* Suppress warnings when a repository that can satisfy unnatural Ruby versions is provided
* Install rubygem integration packages that integrates gems with distribution packages (YMMV with those)
* Get rid of ruby-switch and depreciate the `switch` parameter (overloaded onto `set_system_default`)
* New `set_system_default` parameter that uses puppet to managed links to the `ruby` and `gem` binaries directly, because:
* `ruby-switch` was not widely available
* `update-alternatives` does not support Ruby in Ubuntu 14.04
* what could possibly go wrong
* `set_system_default` warns when Ruby versions will not be satisfied by default packages, which can be suppressed.
* default binaries for ruby and gem can be specified for `set_system_default` to use

Finally, the spec tests for the base `ruby` class was horrible, unstructured, and incomplete. Totally ~~copy and pasted~~ rewritten and now applies all tests to all the supported distributions and releases.

I'd have considered beaker tests but this is [Windows](https://github.com/puppetlabs/beaker/issues/373) so I tested them all on Ubuntu 12.04LTS, Ubuntu 13.10, and Ubuntu 14.04 with my [vagrant harness](https://github.com/Aethylred/vagrant-puppet-harness)