(PUP-2511) Add parser function digest: uses digest_algorithm to hash, not strictly md5

Puppet has an md5 parser function, which returns the MD5 digest of its
argument. On hosts configured for compliance with U.S. Federal
Information Processing Standard (FIPS) 140-2, attempts to use the MD5
algorithm cause errors, because MD5 is no longer FIPS Approved. This
patch adds a parser function called digest, which returns the digest
of its argument using the algorithm named by the digest_algorithm
setting in puppet.conf. Therefore, where md5 may fail on some hosts,
the digest function should always return a value; but the value may
vary if the digest_algorithm setting is changed.
(PUP-2578) Unbreak services from packages which set local flags.

So don't add _flags="" for pkg_scripts if no :flags were set, as it
may override the default flags from inside the script.
(PUP-2578) Keep order for pkg_scripts.

Do not unconditionally alphabetically sort the list of pkg_scripts
as order matters. Explicit ordering will need to be forced through
resources dependencies.
(PUP-2578) Tweak #in_base? by not relying on pkg_info, but on /etc/rc.conf which is faster
(maint) Quote class name in init.pp template

According to the style guide:

All resource titles should be quoted. (Puppet supports unquoted resource
titles if they do not contain spaces or hyphens, but you should avoid
them in the interest of consistent look-and-feel.)

A class is a resource.
(PUP-2663) Allow string to contain leading sign in numeric conversion

This makes it possible to use an unary +/- in a string. The sign
of the converted value abides by the unary string sign. White space is
allowed around the sign, and at the end of the string.

'+ 2' + '- 2' == 0

This is of value when dealing with original data in string form
that needs to be converted. Without this it is especially difficult to
pass a negative value around in string form.
(maint) Remove redundant code
(PUP-2691) Re-adding the missing ‘description’ property to P::MT::Metadata.

Prior to Puppet 3.6.0, users had a ‘description’ property which they
could reliably expand into their module skeleton’s ERB templates.  This
property was removed from the default set of properties in Puppet 3.6.0,
which effectively broke template expansion for users relying on it.

This change ensures that users can continue to rely on this property.
(PUP-2703) Make 'tag' be a statement function

Tag function should not require parentheses.
(PUP-1852) Deprecate the 'search' function.

This function is deprecated because support for dynamic scoping
has been removed in general and this function makes it possible
to abuse the systems ability to search multiple disjunct name-spaces.
(maint) spec: allow expectations of resources from compiled manifests

Add logic to the PuppetSpec::Compiler.apply_compiled_manifest method so that
a spec test can supply a block that processes the single resources
that comprise that catalog that was compiled before it is run in a transaction.

As a proof of concept and general helper, add a apply_with_error_checks method,
that adds an expectation to never send an :err signal to each resource. This
makes spectest debugging much easier, because without expectations,
the transaction will just finish and the only reported error will be that the
end result is not as expected. When the expectation is added to each resource,
rspec will display all resource error messages as failed expectations.
(PUP-1100) Create_resources syntax error message spec test

This commit adds a check for the create_resources syntax error message.
If there is a syntax error, the error given by puppet master is unclear.
This commits adds a test to check that the error message is correct and
makes sense.

This only happens when the resources are auto imported, which is why I
use a fixture directory.
(PUP-1100) Fix error message with create_resources and auto-loaded class

This commit fixes the error message displayed by PM when a syntax error
is present on an file auto-loaded by create_resources.
(PUP-2271) Allow yumrepo proxy attribute to be set to _none_

Add fix and test to allow proxy to be set to _none_ to bypass global proxy
configuration for YUM.

See https://tickets.puppetlabs.com/browse/PUP-2271
(PUP-2738) FFI::Pointer#read_win32_local_pointer

 - Create new block style helper that automatically calls LocalFree on
   a returned pointer after it's done being used. Since the ptr is no
   longer valid after the block yields, return nil from the method
 - Move FFI definition for LocalFree into FFI::WIN32 and out of
   Puppet::Util::Windows::Error and Puppet::Util::Windows::SID
 - Ensure that proper wide string is resolved / passed out of
   Puppet::Util::Windows::Error.format_error_code and
   Puppet::Util::Windows::SID.sid_ptr_to_string when resolving string
   inside of a block
 - Refactor Puppet::Util::Windows::SID.valid_sid? to read ptr inside
   block, use closure to store the 'valid' return value
(PUP-2758) Add micro benchmark(s) task

This adds a benchmark that runs a series of puppet manifests that
are measured individually for parse and evaluation time. Each
manifest is measured 100x each for parse and evaluation. The benchmark
total time includes running all of them (including overhead of
measuring the details). Details are output as average of all runs
per detail where parsing and evaluating is output as separate entries.

The sample file written is for the total average.
(PUP-2758) Add passing arguments (warm_up and detail) to Benchmarker.run

Arguments are needed to be able to run one detail of a benchmark.
The evaluations benchmark makes use of this, all others ignore the
arguments.
(maint) Correct typo in loader helper class and add tests

Loading the same function multiple times from modules caused
an error because of a typo in NamedEntry. This adds tests for the
helper classes basic functionality, and adds tests that loaders indeed
can load a function more than once.

This also corrects error handling (yet another typo) when a function was
redefined (the wrong method was called).
(PUP-2758) Add calls to 3x, 4x, and namspace 4x functions to evaluations

This adds additional benchmarks for function calls using 3x calls,
4x calls in global namespace, and name spaced to a module.

A simple assert_type benchmark is also added (one simple type check).
(PUP-2758) Generate tasks with arguments defined by benchmark

This makes it possible for a benchmark scenario that wants
additional details to run a smaller portion of the benchmark to
configure these by defining a class called BenchmarkerTask (currently
only used by the evaluations benchmark). The separation from the
Benchmarker class is that this class is loaded when rake generates a
list of tasks, and it is not wanted to load each full benchmark in turn
to generate this list. (Over time, the BenchmarkerTask can be expanded
on to perform other task generation duties).

It is now possible to run all of the evaluations benchmarks,
profile all, run one particular micro benchmark, or just its parse or
evaluation part by suffixing the name with _parse or _eval. As an
example rake benchmark:evaluations:run[assert_type_eval] runs only the
evaluation part of the assert_type micro benchmark in evaluations. (This
is especially useful when running profiling.

For profiling, the parameter warm_up_runs is always included.