puppetlabs/puppet — pull request #575 by daniel-pittman (2012-03-12 16:59:02+00:00)
Title: Real, complete Ruby 1.9 support - at least in the tests

Ruby 1.9 was nominally a supported platform, but we didn't even have all the tests passing. It only "worked" in the sense that the code didn't obviously blow up for some people using it, and the tests "passed" in the sense that they worked fine, provided you didn't run any of the tests that revealed bugs.

This set of changes fixes that by identifying the root cause of each failure and fixing the genuine bugs in Puppet that led to test failures. (It also fixes a bunch of places where test stubs were making all sorts of strange assumptions, like `"foo"[:bar] => nil`, and other 1.8 oddities.

Key changes are:

* disable RDoc support on versions we can't integrate with.
* catch 1.9 as well as 1.8 `require` failure messages.
* replace complex locking around files with simple and obvious atomic replace.
* handle the new Psych YAML parser in Ruby 1.9.
* fix ZAML to correctly emit binary and Unicode data.
* handle changes to `instance_variables`, `methods`, etc.
* fix the monkey-patch version of `lines` to work like, well, `lines`.
* fix the monkey-patch version of `binwrite` to work like, well, `binwrite`.
* partially fix PSON vs non-Unicode content on 1.9.