(maint) Don't setup puppet.conf for facter acceptance setup
(FACT-186) Express windows specific gem dependencies

Previously, if a ruby module on windows tried to use facter as a
library, the calling module had to know about facter's platform specific
dependencies. This comes up when trying to develop and test puppet
modules on windows.

This commit adds the windows specific gems (which mirror the Gemfile) to
project_data.yaml. The build pipeline will automatically create an
x86-mingw32 gem in addition to the generic one.
Revert "(maint) Workaround travis/rubygems failures with ruby 1.8.7"

This reverts commit 6ab0a03b53994dd7dd4a0243c31a4d81613dfccf.
Merge pull request #587 from adrienthebo/maint/stable/acceptance-remove-puppet.conf-setup

(maint) Don't setup puppet.conf for facter acceptance setup
21760/22005 update preflight to delete old lib dir

In order to install in the top-level site_ruby directory, we need to clean out
any installs in the old site_ruby/1.8 location. We're doing this by setting a
variable in the package:apple task. If it's set, we remove all files there as
well as files in the new location.

While I'm here:
* update erb to strip leading and trailing spaces
* validate critical variables so a script is never generated with dangerous paths
* only target top-level files/dirs in lib, since we're doing rm -RF anyway
Use Dir.glob(), don't require rubygems or rake, use Dir.chdir as a block
use instance_variable_get instead of eval
(21868) Move facter libary target to /Library/Ruby/Site

We currently drop the facter library files in /usr/lib/ruby/site_ruby/1.8
OSX, which is a symlink to /Library/Ruby/Site/1.8. As of OSX 10.9 Maverick
this will no longer work because it will be ruby 2.0.0. There are hard way
and easy ways to solve this problem. A hard way would be to somehow
introspect the target host at install time, and then dynamically copy the
payload into the correct ruby version specific path. Another hard way woul be
to create different OSX packages for different versions of OSX. Or, we could
pick the easy way, which is to just install into /Library/Ruby/Site (the
equivalent of /usr/lib/ruby/site_ruby). Since facter will work on all rubies
shipped with supported versions of OSX, this will "just work".

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #593 from MosesMendoza/21868/stable/cherry_pick_mavericks_pkging

21868/stable/cherry pick mavericks pkging
(FACT-186) Consolidate gem runtime dependencies

Previously, the Gemfile and ext/project_data.yaml both described gem runtime
dependencies, the former requiring an exact match, the latter a pessimistic
match.

This commit makes project_data.yaml be the single source of truth, and it
specifies exact versions.

Rubygems and bundler have different ideas about what constitutes a platform.
Rubygems requires an arch and os, e.g. x86-mingw32, while bundler has a
hard-coded list, see Bundler::Dependency::PLATFORM_MAP. As result, we need
to use the rubygems platform when building the facter gem, but use the
bundler platform when expressing gem dependencies.
(FACT-134) Redo tests so the work on ruby 1.8.x

No String#encode or Encoding in ruby 1.8.x, update tests accordingly.
Merge branch 'stable' into facter-2
Extract Facter execution methods to mixin

The command execution methods in Facter::Util::Resolution were
cluttering up the class and breaking the single responsbility principle.
Leaving them around increases the complexity of refactoring the
Resolution class.

This commit extracts methods related to command execution to a mixin and
extends the Resolution class with the mixin to maintain compatibility.
In the long term we should deprecate the compatibility methods.
Move execution module from util to core
Merge pull request #590 from adrienthebo/facter-2-extract-execution-methods

Extract Facter execution methods to mixin
(#22107) Force ASCII-8BIT encoding on raw data in property lists

Ruby-1.9 and up default to UTF-8 encoding for strings, but CFData is
used to store bytestrings in plists as read from file-like objects.  So,
disregard the encoding returned from `obj.read`, treating the string as
a bytestring.
Merge branch 'pull-513' into stable

This closes GH-513
(maint) Redirect dmidecode stderr to /dev/null

Previously most calls to dmidecode had stderr redirected to /dev/null.
dmidecode tends to have error messages that go to stderr during execution,
which pollutes facter runs. This commit updates the remaining calls to
dmidecode to also redirect stderr to /dev/null so that facter runs can continue
in blissful ignorance of any dmidecode errors.
Merge pull request #596 from haus/stable

(maint) Redirect dmidecode stderr to /dev/null
(maint) Update virtual spec to match dmidecode invocation

A previous commit updated the dmidecode invocation in util/virtual.rb, but it
did not update the corresponding spec test, which stubs the invocation to
return 'something'. This commit updates the virtual spec tests to stub the
updated invocation.