mkrakowitzer/puppet-stash — pull request #13 by GeoffWilliams (2014-08-07 01:22:01+00:00)
Title: fix path to ruby executable on puppet enterprise

Hi Merritt,

I've put together a fix for for https://github.com/mkrakowitzer/puppet-stash/issues/12 -- which stops the external facts in this module from working with Puppet Enterprise in some situations.

I've changed the shebang in the external facts script to be sourced from a variable instead of hardcoded and am switching the Ruby interpreter based on the value of the $::puppetversion fact.

* Puppet Enterprise will source ruby from "/opt/puppet/bin/ruby"
* Puppet OSS will source ruby from "'/usr/bin/env ruby" -- this is more portable then hardcoding the full path to Ruby

I've added tests for the above in the file spec/classes/stash_facts_spec.rb

Cheers,
Geoff