puppetlabs/facter — pull request #142 by kbarber (2012-01-10 15:20:58+00:00)
Title: Ticket/1.6.x/11559 rbconfig deprecation

In Ruby 1.9.3 we started to see warning messages about the deprecated usage of
the class 'Config' as apposed to 'RbConfig'. This patch switches all our code
to 'RbConfig' instead.

Now the constant RbConfig was aliased to Config going back to Ruby 1.8.5, but
for pre-1.8.5 ruby this was not done. To support our Ruby 1.8.1 user base
(due to RHEL 4 predominantly) this provides a monkey patch util library which
provides the same alias (conditionally) but for older rubies instead.

This methodology is seen as less intrusive and less maintainance going forward
then to create conditionals everywhere, or a facter-only backwards compatible
alternative to RbConfig. And since its the similar methodology adopted by Ruby
core (more or less) it should be a monkey patch with low surprises.

I've also added testing around the facter/util/config.rb library.

Thanks to James Turnbull for the original code for
this patch.