puppetlabs/facter — pull request #161 by jeffmccune (2012-01-31 01:47:06+00:00)
Title: Feature/1.6.x/12066 windows puppet facter build

Without this patch applied the default behavior of install.rb is to
write a facter.bat file using an inline string. This is a problem
because we also need a facter.bat file for the MSI packaging rake task
in the Puppet project.

This patch address the problem by moving the `facter.bat` file out of
the inline string in install.rb to a stand alone file.

The patch also leaves the code in a better state than I found it by
replacing insecure temporary file behavior with a more secure and less
predictable Tempfile.open call.

This patch should also address all of Josh Cooper's comments at [1] in
that facter no longer automatically hard codes the `--puppet` flag. I
removed it because Puppet may not actually be installed as Josh pointed
out.

[1] https://github.com/puppetlabs/puppet/pull/417#commitcomment-909040