puppetlabs/facter — pull request #433 by joshcooper (2013-04-19 09:07:01+00:00)
Title: (#20301) Handle different error in ruby 1.9

The NumberOfLogicalProcessor property of the Win32_Processor WMI class
does not exist in the base win2003 install. Previously, we were trying
to access the property, and then catching the resulting error if the
property did not exist.

In ruby 1.8, it would raise a RuntimeError, but in ruby 1.9, it raises a
StandardError, causing the fact to blow up on ruby 1.9.

This commit checks to see if the process object responds to that method,
and only then does it try to call it.