So this has already been done [here](https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/facter/pe_version.rb)