(maint) Scrub whitespace on global setting descriptions when inserting into man pages

These text blobs use the hanging indent style used in a lot of our embedded doc
strings, so we have to handle that indent properly with scrub.
(PUP-1707) Fix possible gsubs on nil in man page ERB template

In several places, this template would attempt to fall back to summaries if long
descriptions were absent. However, before deciding to use the summary, it would
attempt to do a gsub on nil, which would blow up the entire process.

This commit does the fallback earlier, and adds final fallback text so we won't
be using text methods on nil if the summary is also absent.
(PUP-1676) Puppet::Settings retrieves directory environment settings

During a Puppet[:setting] call, legacy environment settings would be
loaded from a puppet.conf stanza.  But settings from directory
environments would never be seen.  Areas in the codebase could obtain
per environment settings by looking them up directly from an
environment.  However a call to puppet config or to an application with
--configprint, would return the default modulepath if redirected to a
directory environment using the --environment setting.

A ValuesFromCurrentEnvironment class has been added to Settings to
lookup environment settings not found in puppet.conf if there is a match
with the :current_environment from the Context.

Because of the need to access a global modulepath for environment and
directory loader construction, a setting, :basemodulepath, has been
added, so that we can initialize without fear of recursing infinitely
looking up :modulepath.

The possibility for recursion has been there since at least 3.0.0:

[legacy]
modulepath=/foo:$modulepath

would overflow the stack. It could now be:

[legacy]
modulepath=/foo:$basemodulepath
Merge pull request #2369 from jpartlow/issue/master/pup-1676-puppet-config-print-and-direnvs

(PUP-1676) Puppet::Settings retrieves diectory environment settings
(PUP-1677) Fix tests for PE compatibility

1) A SLES compatibility issue was fixed

2) the reset_agent_ssl helper does not work on PE. A test which relied
on it would fail because it used duplicate certificate names. That
test was updated to use unique certificate names for each cert
request, to avoid duplicate cert issues.
Merge pull request #2371 from branan/fixup_tests_for_pe

(PUP-1677) Fix tests for PE compatibility
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-1677) Fix tests for PE compatibility
(PUP-1592) Speed up loading of user defined types by 2x

When a user defined type is loaded a check is always first made
to see if the name loads a resource type implemented in ruby. The
majority of loads are for non ruby types. The loading must be done with
higher precedence of ruby based resource type over user defined.

This optimization capitalizes on the fact that ruby resource types are
in a flat name space and thus their names can never contain '::'. The
optimization is done in metatype/manager.rb where now an attempt to load
from the type loader is avoided if the name contains a ':'.

This achieves a 2x speedup and generates less permanent garbage (all
user defined type names where internalized as symbols, never to be
gc'd).
(PUP-1676) Environmentpath acceptance test uses basemodulepath

Given that the Directories environment loader gets initialized with
basemodulepath, we have to adjust the master puppet.conf for
use_environment_from_environmentpath.rb to also use basemodulepath so
that we find globally installed modules.
(PUP-1707) Ensure puppet man works for all applications

Adds a spec test that ensures `puppet man <app>` exits with 0 and does
not emit the 'undefined method' error reported in PUP-1707.
Merge pull request #2373 from hlindberg/pup-1592_avoid-type-search

(PUP-1592) Speed up loading of user defined types by 2x
Merge branch 'pr/2359'

* pr/2359:
  (PUP-1707) Ensure puppet man works for all applications
  (PUP-1707) Fix possible gsubs on nil in man page ERB template
  (maint) Scrub whitespace on global setting descriptions when inserting into man pages

Closes GH-2359
Merge branch 'issue/master/pup-1676-basemodulepath-acceptance-fix'

* issue/master/pup-1676-basemodulepath-acceptance-fix:
  (PUP-1676) Environmentpath acceptance test uses basemodulepath
Merge branch 'master' of https://github.com/puppetlabs/puppet