(PUP-1527) After upgrade from 3.3.2-1 to 3.4.2-1 naginator fails to
create config from exported resources taken from hiera

Some changes introduced in hiera around 3.4 resulted in type coersion
from strings to FixNums when creating exported resources that were
partially built from hiera data.

This patch ensures that any non-array parameter passed through the
Nagios::Base.to_s is actually a string before trying to run the .sub
method on it, and so fixes the above error with exported resources
whilst also introducing support for fixnum params for any of the nagios
type parameters
(PUP-3050) Update cfacter option for recent cfacter gem changes.

Now that cfacter implements the Ruby Facter interoperability layer, there
is no need for Puppet to "switch out" the Facter module for the CFacter
module.  libfacter itself will now expose a compatible Facter module in
C++.

Therefore, we no longer need facts.rb or the corresponding spec.
Instead, simply require cfacter and call CFacter.initialize.  This will
replace Ruby Facter with the libfacter implementation.
Merge pull request #2965 from peterhuene/pup/3050

(PUP-3050) Update cfacter option for recent cfacter gem changes.
(PUP 229) Fix /etc/shadow parsing so that max/min_age is reported correctly

Before this patch, parsing /etc/shadow, when empty trailing fields were
present, they were discarded, and inturn a nil check was used to ensure that
the fields did not exist. However, this ran into trouble when a value was
appended to the end, causing all the empty fields to be returned as empty
strings instead, failing the nil checks.

This patch ensures that all empty fields are returned as empty strings, and
a check for empty string is used to check whether the field exists or not.
Merge pull request #2975 from vrthra/fix/pup229/maxage

(PUP 229) Fix /etc/shadow parsing so that max/min_age is reported correctly
Merge pull request #2933 from rdark/fix/master/pup1527

(PUP-1527) After upgrade from 3.3.2-1 to 3.4.2-1 naginator fails to crea...
(PUP-2924) Initialize resources from Type classes

This patch extends the signature of `Puppet::Resource#initialize` to accept
subclasses of `Puppet::Type` as arguments. This allows `resource_type` to be
set during initialzation for some cases and eliminates a later, costly, call to
`environment.known_resource_types`.
(PUP-2349) Treat mode strings as octal

Previously there was logic to convert incoming mode using to_i,
but if it were a String that would convert the string as decimal,
whereas mode is always specified as octal. I don't know why the
to_i conversion was in there and whether it ever worked in a
meaningful way.

So fix this to convert Strings as octal.
(PUP-2349) Specify mode as a string containing an octal mode

Previously, mode was specified in some places as a Fixnum, in others
as a String. Consistently specify mode as a string containing octal.
(PUP-2349) Add deprecation warning for non-string mode property values

The 'future' (4.x) parser treats literal numbers as actual numbers instead of
strings as the 3.x parser did. This makes file resources that use unquoted
mode values behave strangely (see PUP-2156) so we are deprecating non-String
values for mode.

So this change adds a deprecation warning for non-String values of mode
when running with --parser future.
Merge pull request #2964 from kylog/issue/pup-2349/deprecate-non-string-modes-on-file-type

Issue/pup 2349/deprecate non string modes on file type
Merge pull request #2979 from Sharpie/pup-2924-resource-new-types

(PUP-2924) Initialize resources from Type classes
(maint) Cleanup comment

The comment had trailing whitespace and a comma. It makes more sense
without either.
(maint) Extract language specification tools

The resource_expressions_spec contained a useful way of writing language
specification tests. This extracts those out so that they can be reused
in other places.
(PUP-3054) Ensure that inherits are absolute

PUP-121 was supposed to make all references to classes and resource
types absolute, but it looks like it missed a spot. The class referenced
in an inherits clause was not being looked up in an absolute manner,
which caused it to find the wrong parent class in certain cases. This
changes the future parser so that inherited classes are always absolute
names.
(maint) Express language tests in puppet language

This changes the tests of the puppet language, which should become part
of the language specification's example and test suite, to be entirely
expressed in the puppet language. This removes any dependency on ruby!
Well, any dependency on ruby for specifying the language tests.
(perf) Several small performance improvements

This removes some "dev mistake" error checking, which reduces the
overhead of some common calls. It also makes some calls less common,
most notably it caches the environment of a node when it wasn't
explicitly set and it falls back to using Puppet.lookup(:environments).
This can drastically reduce the number of environment lookups in some
situations. For the resource_expression_spec.rb tests, this resulted in
a 0.6 second improvement (~3 seconds to ~2.4 seconds).
(perf) Speed up setting lookup

One of the slowest thing for tests is setting values. They are reset and
changed often. This speeds up a few of the settings code paths by
removing unneeded method calls, either by introducing local variables,
or using delegators. In addition the ChainedValues objects are held on
to so that if the same environment and section is needed again it
doesn't need to be recreated.
(maint) Fix optimization that altered semantics for += production
(maint) Improve two test by checking they have no effect on catalog.

It is now possible by checking if the result of a "produce" had
no effect on the catalog by comparing against an empty array.