(PUP-3258) node exec indirector: default to environment, not its name

Nodes can be classified through a local executable that prints YAML with
a node specification. This is enabled through the node_terminus=exec option.
Since PUP-2519, this setting would break `puppet apply`. Trying to apply
any manifest would lead to Puppet applying the default environment's site
manifest instead.

The reason for this is that the node terminus will include the current
environment's name in the node lookup result. This in turn makes Puppet
look up the environment per name. This is not the desired behavior, because
Application::Apply performs the lookup and further operations with a localized
environment that overrides the site manifest.

Solved by including the current environment object in the returned node object
instead of its name.
(maint) reduce repitition in Application::Apply integration spec
(PUP-3308) Remove deprecation warning about cron purge change

This commit removes deprecation warnings for the :purge attribute
of the cron resource. Previously, when 'purge' was set to true
for unmanaged cron resources, Puppet would fire off a warning
about the 'purge' option becoming more aggressive in future versions.

This update is part of the code removal effort for Puppet 4.
(maint) Remove duplicate file handling code

The tests had their own way of creating files and directories for
testing. All of these different ways of creating files and directories
already existed in PuppetSpec::Files. This unifies them.
Merge branch 'pr/3144' into stable

* pr/3144:
  (maint) Remove duplicate file handling code
  (maint) reduce repitition in Application::Apply integration spec
  (PUP-3258) node exec indirector: default to environment, not its name

Closes GH-3144
(PUP-3306) Remove deprecated Puppet::SSL::Inventory#serial method

This commit removes the deprecated `serial` method from the
Puppet::SSL::Inventory class. It is replaced by
Puppet::SSL::Inventory#serials.

This commit is part of the Puppet 4 code removal effort.
Merge pull request #3153 from whopper/pup-3306/remove_serial_method

(PUP-3306) Remove deprecated Puppet::SSL::Inventory#serial method
(PUP-3239) Refactor node environment validation

Prior to this, the compiler was responsible for testing the environment
and producing an error message.  This change pulls the validation step
into node environment, breaking the error message up so that any
component can check if an environment has setting conflicts and return a
uniform error message.  This will make it easier to add other
environment checks.

We refrained from including a more general error message handling
mechanism similar to what is currently in POPS because generalizing that
is a bigger task more suited to a broader internationalization epic.
Merge pull request #3117 from demophoon/feature/master/pup-3239-environment-validation

(PUP-3239) Stop compilation if $environment has bad manifest settings
(PUP-2350) Fixup Windows tests for removal of non-string file mode support

This commit updates several Windows-only spec tests so that they
adhere to the recent removal of support for non-string file modes.
(PUP-3351) Evaluate ENC classes in the correct order

Without this patch classes declared from an ENC are evaluated in the
wrong order.  This is a problem because classes declared without
parameters are evaluated prior to classes with parameters which causes
an Error: Duplicate declaration when the classes with parameters are
evaluated.  According to the code comments for the
`evaluate_node_classes` method, the expected behavior is that classes
with an empty set of parameters will not conflict with classes that have
declared parameters.
(PUP-3351) Test using example of problematic behavior

After talking with Reid Vandewiele, it turns out that the problematic
behavior isn't directly the order of the classes themselves. Previous
assertions that there are possible conflicts from the classes when they
were done in one order or another are incorrect. The classes, when any
have parameters, are kept by the node in a hash keyed off of the class
name, which means that there is no possibility of them creating a
duplicate resource error.

The actual usecase comes down to *how* parameterized classes vs
unparameterized classes are often used. A parameterized class can often
be simply a set of shared data that the unparameterized classes depend
on (or inherit from) parameterized classes.

This modifies the test case for the reordering change to provide an
example of the use case here.
Merge branch 'pr/3126' into stable

* pr/3126:
  (PUP-3351) Test using example of problematic behavior
  (PUP-3351) Evaluate ENC classes in the correct order

Closes GH-3126
Merge pull request #3156 from whopper/pup-2350/file-mode-test-fixup

(PUP-2350) Fixup Windows tests for removal of non-string file mode support
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-3351) Test using example of problematic behavior
  (PUP-3351) Evaluate ENC classes in the correct order
  (maint) Remove duplicate file handling code
  (maint) reduce repitition in Application::Apply integration spec
  (PUP-3258) node exec indirector: default to environment, not its name
(PUP-3299) Remove deprecated Puppet::Util::CommandLine methods

This commit removes the deprecated class and instance methods
`available_subcommands` from the Puppet::Util::CommandLine class.
They are replaced by `Puppet::Application.available_application_names`.

This commit is part of the code removal effort for Puppet 4.
(maint) Quote File modes in acceptance environment_utils

The acceptance/lib/puppet/acceptance/environment_utils.rb still had some
unquoted mode values, which now fail outright with the future parser in
master. Quoting them should fix this.
Merge pull request #3157 from whopper/pup-3299/removal/commandline_methods

(PUP-3299) Remove deprecated Puppet::Util::CommandLine methods
Merge pull request #3147 from whopper/pup-3308/remove-cron-purge-warning

(PUP-3308) Remove deprecation warning about cron purge change
(PUP-3277) Remove classifier_utils from no_enc test

This test setsthe node_terminus to plain and does not interact with the
classifier.  Consequently we don't need to adjust any of the groups for
this test.