(#18110) Don't do recursive backup when not needed

First check if we are actually going to replace the directory before
starting to do a backup of it.
(#18110) spec tests for bug fix
(maint) Add YARD to Puppet::Util::Errors
(#19558) Add resource and manifest context to type validation failures

When a resource fails validation with a validate method defined at the type
level (rather than individual parameters), provide additional context with the
resource name, manifest file and line number.
(#19558) Add manifest file/line to parameter validation failures

For consistency, provide manifest file and line number in the error message
when a parameter fails to validate.
(#19558) Only catch Puppet::Error and ArgumentError when validating parameters

Parameter validation methods are expected to only throw Puppet::Error
derivatives (i.e. via the fail() method) or ArgumentErrors, so specifically
catch these.
(Maint) Fix assertion about module tool output

Commit b48402229adcd11b9f1293725f74703670f346c5 changed the output of
the module tool so that it matched the options that is actually has. The
acceptance test, however, was not updated at the same time. This updates
the relevant tests to include the updated text.
Merge branch 'domcleal-tickets/master/19558-validation-errors'

* domcleal-tickets/master/19558-validation-errors:
  (#19558) Only catch Puppet::Error and ArgumentError when validating parameters
  (#19558) Add manifest file/line to parameter validation failures
  (#19558) Add resource and manifest context to type validation failures
  (maint) Add YARD to Puppet::Util::Errors
(#19558) Fix acceptance test failure

Without this patch applied the commit in 38ef0c5 causes a behavior
change in the way error messages are formatted that fail to pass through
the regular expression used in our Solaris 10 acceptance test suite.

This patch addresses the problem by updating the regular expression to
match the error message produced by the current behavior of the system.
(maint) refactor Type::File#remove_existing

Puppet::Type::File#remove_existing was providing too many behaviors and
was becoming unreadable. It checked if a file could be backed up,
performed the backup, failed if the backup failed, and conditionally
removed files and directories.

This commit refactors the method and extracts a number of different
methods that each implement a part of the behavior desired. This commit
also standardizes the return value of the method to boolean values and
adds some documentation on the method signature and exceptions raised.

Paired-With: Andy Parker <andy@puppetlabs.com>
Merge branch 'pull-1502'
Ensure 'agent' subcommand is executed

Ensure 'agent' subcommand is executed when PUPPET_SERVER is set in the puppet environment.
Merge branch 'fix/3.1.x/suse_init' into 3.1.x

* fix/3.1.x/suse_init:
  Ensure 'agent' subcommand is executed
Merge branch '3.1.x'

* 3.1.x:
  Ensure 'agent' subcommand is executed

closes #1520
(#19663) Remove --include-dependencies flag in gem package provider

Without this patch applied the gem package provider will always pass the
`--include-dependencies` flag to the gem command.  This flag has been
deprecated in Rubygems for quite some time.  The behavior of including
dependencies when installing a gem has been the default for some time,
so this patch does not change behavior for any recent version of
Rubygems since 0.9.5.

Here is the comment from the pull request:

This is a good explanation about the option: rubygems/rubygems#385

It was already deprecated since rubygems 0.9.5 and was the default
option since then.

Unless someone is using a version of rubygems from mid 2007, this option
is never being used
https://github.com/rubygems/rubygems/blob/a00fc76fb6b959385331715c500af1eb25590405/History.txt#L1451
Merge branch 'juniorz-patch-1'

* juniorz-patch-1:
  (#19663) Remove --include-dependencies flag in gem package provider

closes #1517