(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) Normalize copies of fact string values

Previously, facter would fail to normalize a frozen, non-UTF8 encoded
string, such as the value returned by the `rubyversion` fact.

This commit changes the normalization module to make a copy of the
resolved value, and perform string encoding on that. It also undoes the
change to Factet::Util::Loader that dup'ed environment variables of the
form `FACTER_*`.

Paired-with: Andy Parker <andy@puppetlabs.com>
Merge branch 'issue/facter-2/encoding-frozen-strings' into facter-2

* issue/facter-2/encoding-frozen-strings:
  (FACT-134) Normalize copies of fact string values
Merge remote-tracking branch 'upstream/facter-2'

* upstream/facter-2:
  (FACT-134) Normalize copies of fact string values

Conflicts:
	spec/unit/util/resolution_spec.rb
(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 remote-tracking branch 'upstream/facter-2'

* upstream/facter-2:
  (FACT-134) Redo tests so the work on ruby 1.8.x

Conflicts:
	spec/unit/util/resolution_spec.rb
Merge branch 'stable' into facter-2
Merge branch '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