More details in metaparameter redefinition warning

Definitions which redefine metaparameters, such as the following,
generate a warning because metaparameters, unlike normal parameters,
are inherited by all resources contained in the definition:

 define contact_info($alias = undef) {
   ...
 }

To find and fix this problem in the manifests we need to know where
the parameter is defined or at least the name of the definition, which
is now part of the warning message.
(#14296) Improve template function error message.

The current template function does not provide sufficient detail for
troubleshooting. This patch uses the backtrace to provide the fully
qualified filepath and line number.

Previous error message:
Failed to parse template test/example.erb: undefined method `[]' for
nil:NilClass at /tmp/module/test/manifests/init.pp:2 on node example

New error message:
Failed to parse template test/example.erb:
  Filepath: /tmp/module/test/templates/example.erb
  Line: 10
  Detail: undefined method `[]' for nil:NilClass
 at /tmp/module/test/manifests/init.pp:2 on node example
Significantly improve compilation performance when using modules

When autoloading classes/defines, the typeloader constructs a set of
possible locations for the class, based on its name. Effectively, it
will look in the canonical locations corresponding to each namespace in
the fully-qualified name. So for each namespace, it will ask the
environment for a Puppet::Module instance for that module, to ask it
which of the module's potentially manifests match the class it's looking
for. To answer that request, the environment instantiates a
Puppet::Module.

This amounts to potentially thousands of Puppet::Module instances being
created, because it does this many times (based on nesting of the class
name) per include/autoload/import. When Puppet::Module instances are
created, they parse and load their metadata.json file, in part to
validate their use. This implies that each compilation results in
metadata.json being parsed thousands of times, which is extremely slow
(and obviously provides no actual benefit).

Fortunately, the environment object already keeps a list of
Puppet::Module instances for every module in its modulepath. The fix
applied here is simply to change the environment such that it provides
modules by looking them up in its cached list, resulting in up to an
order of magnitude improvement in compilation time.
Remove deprecated standalone executables

This removes the standalone filebucket, pi, puppetdoc, and ralsh commands.
Fix loading of constant_inflector

This fixes an undefined module error when loading constant_inflector
Remove the standalone puppet executables in sbin

These have all been deprecated for at least one major release.
The commands are puppetca, puppetd, puppetmasterd, puppetqd, puppetrun.
Whitespace and logic cleanups for command line tests.

There are no functional changes, just cleanups, in this change.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
(#14322) Make `--version` or `-V` options work globally.

The `puppet --version` invocation was broken, and only `puppet $app`
invocations of it worked.  This is undesirable - displaying the version is
very much a global activity, and this reflects that by handling it specially
in the command line parsing.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Remove manpages for legacy executables that are gone
Remove references to legacy executables in the code
Merge pull request #760 from pcarlisle/maint/master/remove-deprecated-standalone-commands

remove deprecated standalone commands
Revert "maint: use relative paths to fixtures."

This reverts commit 7ce9e17cf1077604accc1a5cfe90ad7b1bb99a55.
The change to using Pathname in fixtures is not compatible with Windows.
Merge remote-tracking branch 'daniel-pittman/bug/master/14322-puppet---version-doesn't-work' into bug/master/14322-puppet---version-doesn't-work

* daniel-pittman/bug/master/14322-puppet---version-doesn't-work:
  (#14322) Make `--version` or `-V` options work globally.
  Whitespace and logic cleanups for command line tests.

Conflicts:
	spec/unit/util/command_line_spec.rb
Split out the basic setting behaviors into BaseSetting
Create an exception hierarchy for settings

This moves all settings exceptions into Puppet::Util::Settings and adds
ValidationError and InterpolationError.
Move settings out of util
Merge pull request #688 from ustuehler/master

Better warning about metaparameter redefinitions
Move rubygems require to executable entry points to Puppet

We were trying to load rubygems in lib/puppet.rb so that we could load other
libraries installed as gems, but this isn't anywhere near the first file
loaded. By moving this into bin/puppet and other executable entry points, we
ensure that rubygems is loaded as early as possible.
Merge pull request #738 from nanliu/ticket/2.7.x/14296

(#14296) Improve template function error message.
Merge pull request #748 from pcarlisle/maint/master/rubygems-i-hate-you

Move rubygems require to executable entry points to Puppet