Merge pull request #2358 from nfagerlund/docs_evaluator_setting

(maint) Revise docs for evaluator setting
(PUP-1029) Improve error message consistency and information

This improves the consistency and content in the iterative functions
when the given block has too few, or too many parameters. 

It now shows what is expected logically, how many parameters were
defined, and what their names are.
Merge branch 'pup-1029_improve-iterative-function-errors'
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (maint) Set required conf parameters to make benchmarks do something
  (maint) Make benchmark:defined_types work on 3.4.2
  (maint) Backport benchmarking from 3.5 to 3.4.2
  (PUP-751) Check for reparse once per compile
  Revert "Add initial support for building in a RHEL 7 mock"
  (maint) Switch from -fd to -fp for specs to reduce disk space usage

Conflicts:
	benchmarks/defined_types/benchmarker.rb
	benchmarks/defined_types/puppet.conf.erb
	benchmarks/many_modules/benchmarker.rb
	benchmarks/many_modules/puppet.conf.erb
	ext/build_defaults.yaml
	lib/puppet/indirector/resource_type/parser.rb
	lib/puppet/node/environment.rb
	spec/unit/node/environment_spec.rb
(PUP-1473) Fix issue with UTF-8 in user comments

GH-1943 included a change to munge the comment property on the user
type so that it gets encoded as ASCII-8BIT. This was to allow the comment
property to handle UTF-8 values as existing values are read as ASCII-8BIT.

Originally the change called `force_encoding` to force the encoding to
ASCII-8BIT. This method does not actually attempt to encode the string, it
only changes the string's associated encoding. It was suggested during code
review that a call to `encode` should be used instead. However, calling
`encode` will fail if the string has UTF-8 characters that cannot be
represented in ASCII-8BIT.

As we desire the comment property to be treated as a squence of bytes in
this case, we should be calling `force_encoding` instead of `encode`.
(maint) Improve Puppet::Util::Docs.scrub's handling of one-liners

One-liner handling wasn't behaving as expected. Sometimes one-liners are
buffered with extra newlines before and/or after, and in these cases, scrub
wasn't catching the leading whitespace.

This commit makes it behave as intended, and adds a test showing the intended
behavior.
(maint) Typo fixes: repeated words (e.g. "the the")
(maint) Fix spec for UTF-8 strings in user comment properties

The first problem with this spec is that it wasn't actually
being run due to an always false "if" clause.  It was checking
for `String` responding to `encode`, but `encode` is an instance
method.  `method_defined?` should have been used instead.

The second problem with this spec is that the test value did not
contain any non-ASCII characters.  If it had, it would have caught
the bug described in PUP-1473.  Added a non-ASCII character to test
for regressions.
(maint) Fix spec for UTF-8 strings in user comment properties

The first problem with this spec is that it wasn't actually
being run due to an always false "if" clause.  It was checking
for `String` responding to `encode`, but `encode` is an instance
method.  `method_defined?` should have been used instead.

The second problem with this spec is that the test value did not
contain any non-ASCII characters.  If it had, it would have caught
the bug described in PUP-1473.  Added a non-ASCII character to test
for regressions.
Merge branch 'pup/1473' into stable

* pup/1473:
  (maint) Fix spec for UTF-8 strings in user comment properties
  (PUP-1473) Fix issue with UTF-8 in user comments

This closes GH-2360.
(Maint) Ensure there is a fully ruby env

The tests were neglecting to require 'rubygems', which meant that they
were not working with the full environment of modules that puppet needs
to run. Setting up the environment is the responsibility of the code
that is going to load puppet, which is why this change was made here,
rather than changing puppet to require rubygems itself.
(maint) Fix two example command lines that were missing 'rake'
(PUP-1722) Permit HTTPS and FTP protocols in yumrepo
(maint) Add newline at end-of-file under lib
(doc) Fix a typo in docs for the include function

There is a typo in the documentation for the include function.
This patch merely fixes that typo.
(maint) Revise help for puppet config subcommand

Mostly adding context about the idea of sections, inc. list of available sections.
(PUP-1584) Module tool acceptance with_environment tests directory envs

Update the acceptance/tests/modules/*/with_environment.rb tests to check
both legacy and new directory environments.  Also extracts common
environment setup to module_utils.
(maint) Banish "configuration parameter"

They are called settings!

Note: Two spec files relied on the wording of an error message I changed.
I revised them to find the new wording.
(PUP-1584) module_tool uses current_environment with target_dir overrides

The module tool was relying on the implicit creation and caching of
legacy environments based on puppet settings for environment and
modulepath.  But this does not work for the new directory style of
environments.  So we are being explicit about using the current
environment from the context, and overriding modulepath to prepend a
target_dir if given, and then directly inserting the environment to be
used into the options rather than expecting the module_tool applications
to retrieve the correct environment from any other loaders.

Testing is now simpler, but because we are now comparing different but
equal environments, I added equality and hash to node/environment to
facilitate this.

This in turn broke tests, because of
Puppet::Node::Environment#known_resource_types which caches using the
global $known_resource_types.  Previously this would always clear itself
when called if $known_resource_types.environment
!= self, but with the new node equality, state was now leaking between
tests.  The test_helper now sets $known_resource_types nil after each
test.
(PUP-1584) Be explicit about adding log functions to root environment

Previously log level functions were being initialized on the root
environment purely as an artifact of initialization timing.  Now we're
being explicit about it.