(PUP-1879) Clear gem path cache when loading library features

Installing gems during a Puppet run should be picked up by features using the
'libs' option.  However gems are installed into separate directories, so
rubygems maintains an in-memory directory cache, which needs invalidating
when attempting to load a library after installation.
(PUP-1769) yum provider takes install_options

The yum provider now supports install_options.
(PUP-1769) Changing the has_feature to a one-liner
(PUP-748) Fix the zypper package provider support for install_options.

When install_options is a hash, the options are rendered with a space.
This is causing zypper to interpret the option incorrectly when
using Kernel.exec.

For example, this fails with "unknown option '--from 1'":
Kernel.exec 'zypper', 'install', '--from 1', 'vim'

While this succeeds:
Kernel.exec 'zypper', 'install', '--from=1', 'vim'

The fix is to use the supported option syntax that uses
an equal sign instead of a space.

Also flattening the options instead of joining them so that
multiple options in a hash are not interpreted as a single option.
(PUP-748) Add specs for zypper install_options.

Remove expected nil when calling execute without install_options.

Add specs for install_options as a hash, array, or string.
(PUP-1751) Fix service provider on Suse to handle boot services.

The current implementation passes the '--check' flag to chkconfig for
Suse OS family. This causes chkconfig to exit with 0 when the service is
enabled and non-zero when the service is disabled or non-existent.

However, for boot services (services that start with 'boot.'), chkconfig
is returning 0 even if the service is disabled or non-existent.

The fix is to stop passing the '--check' flag to chkconfig and instead
parse the output looking for '<service_name>  on' to see if the service
is enabled.
(PUP-1751) Add service provider examples for Suse special casing.

Add spec examples for when a service is enabled, disabled, or
non-existent on a Suse OS.

Remove example that expected the '--check' flag for Suse, as it is no
longer passed.
(PUP-1955) Use symbols not booleans in purge_ssh_keys

Unfortunately, `defaultto false` is somewhat broken: a parameter default of
`false` is cast to `nil` (PUP-1955). This patch alters the boolean
representation of the User Type parameter `purge_ssh_keys` to use Symbols
instead of booleans as `deafaultto :false` works correctly.

Also added some logic to convert boolean values (`true`) and string values
(`"true"`) to symbols during munging. Both of these cases can occur depending
on whether a quoted string or bare word is used to define a parameter in the
Puppet manifest.
(PUP-1955) Generate an empty array when purge_ssh_keys is false

This patch modifies the `eval_generate` method of the User type to return an
empty array if the `purge_ssh_keys` parameter is switched off. Previously a
`nil` was returned which caused an exception during catalog application.
(PUP-1769) Use join_options command

As recommended by @adrienthebo, referencing install_options like this allows
special semantics.
(PUP-1769) Update yum specs with install_options

Specs now take into consideration the install_options parameter, with
both singletons and key-value pairs.
(PUP-1854) add a global Log_level parameter

Attempt at adding a global log_level param to use in puppet.conf and on cli to set the maximum log level (in other words, quiet puppet down)

- debug output cleanup
- move log_level param to main section to allow use everywhere
- leave verbose at info as it was
- Use Eric Dalen's advice and use Puppet[:log_level] (which does work)
(Maint) Convert test to use real resource objects

Use real yum package resource objects
(PUP-1854) add a global Log_level parameter

Attempt at adding a global log_level param to use in puppet.conf and on cli to set the maximum log level (in other words, quiet puppet down)

- debug output cleanup
- move log_level param to main section to allow use everywhere
- leave verbose at info as it was
- Use Eric Dalen's advice and use Puppet[:log_level] (which does work)

As suggested by Andrew Parker
- move setting to Puppet.initialize_settings in puppet.rb
- setting type changed to :enum
(PUP-1769) Don't pass nil through to provider command

Previously, if `install_options` was not specified, then we would
pass a nil value through to the `yum` command. While this would work, we
don't document that nil's are acceptable arguments.

This commit ensures we only pass in non-nil `install_options`.
(PUP-1596) Fix MemoryFile to string conversion in Ruby 1.8

There were two expectations in the previous PUP-1596 work; that a
to_path would permit File functions to operate on a MemoryFile as if it
were a Pathname like thing, and that String#clear was present (in the
spec unit).  A to_str is provided on MemoryFile now for a
File.expand_path and ilk on Ruby 1.8.7, and we're no longer trying to
clear the :content String in the environments_spec.
(PUP-530) Make install.rb check for hiera before installing

From ticket:
The `install.rb` script for puppet checks for facter and will refuse to install
puppet if facter is not on the system. However, puppet also cannot function
correctly without hiera and the `install.rb` script does not check for that.
The installation script that we ship in the tarball should also check for hiera
being present.

This commit adds hiera to the list of prerequisite libraries required before
install.rb will install puppet.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(PUP-530) Add a build depends of hiera

By requiring hiera in install.rb, we force this as a build dependency of puppet
for any platform that depends on install.rb to build packages. This commit
  updates debian and redhat packaging to have a build dependency on hiera to
  satisfy this requirement.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #2450 from jpartlow/feature/master/pup-1596-fix-memory-file-on-ruby-1.8

(PUP-1596) Fix MemoryFile to string conversion in Ruby 1.8
Merge branch 'pr/2414'

* pr/2414:
  (PUP-1769) Don't pass nil through to provider command
  (Maint) Convert test to use real resource objects
  (PUP-1769) Update yum specs with install_options
  (PUP-1769) Use join_options command
  (PUP-1769) Changing the has_feature to a one-liner
  (PUP-1769) yum provider takes install_options

Closes GH-2414