(Maint) Fix rspec options file

The options file for spec testing is wrong without this patch applied.
spec.opts is no longer read by RSpec, instead .rspec in the root of the
repository is read.

This patch removes the old and unused file and replaces it with .rspec
which enables progress format, color, and randomized tests.
(#15464) Make contributing easy via bundle Gemfile

Without this patch the process of figuring out how to quickly set up a
development and testing environment for the Puppet _application_ (not a
gem library) is unnecessarily complicated.

This patch addresses the problem by providing a Bundler compatible
Gemfile that specifies all of the Gem dependencies for the Puppet 2.7
application.

Puppet contributors can now easily get a working development and testing
environment using this sequence of commands:

    $ git clone --branch 2.7.x git://github.com/puppetlabs/puppet.git
    $ cd puppet/
    $ bundle install # Install all required dependencies
    $ rspec

The .noexec.yaml file excludes the `rake` command so that the Gemfile
doesn't raise an exception if the `rubygems-bundler` Gem is installed
and automatically running `bundle exec` for us.

The Gemfile.lock contains the exact dependency versions.  This file is
included in the version control system because we're treating Puppet as
an application rather than a library.
Move Puppet version into lib/puppet/version.rb

Without this patch the entire Puppet library must be loaded in order to
get the version.  This is problematic for executed metadata files like
the rubygems gemspec or bundler Gemfile.

This patch fixes the problem by moving the Puppet.version method and
Puppet::VERSION constant into an isolated small file.  Gemfile and
gemspec files may determine the version using `require 'puppet/version'`
(#15464) Make Puppet usable as a Gem from source

Without this patch it is difficult to use Puppet as a rubygem from a
source checkout.  This is a problem because tools like Bundler will
install the gem from rubygems.org if it believes the gem is not
installed.

This patch fixes the problem by adding a `puppet.gemspec` file and
information in README_DEVELOPER about how to make the repository clone
available as a gem using the GEM_PATH and two symbolic links.
(#15693) Allow restart command to be specified

Previously, the windows service provider did not support specifying a
custom restart command, and instead would always just call stop & start.
The ability to customize restarts is desirable in cases where the service
must be stopped in order to overwrite a file the service is using.

This commit refactors the `instances`, `restart`, and `restartcmd` methods
from the `base` provider to a new parent `service` provider.  It also
refactors the `ucommand` and `texecute` methods.

There are no changes to the `base` service provider other than those
methods residing in the parent `service`.

The `windows` service provider no longer implements the `restart` method
directly as its parent `service` provider handles this correctly.

I didn't refactor the `start` and `stop` methods to make them
customizable, because it's not as critical for Windows and it was more
changes than I wanted to make now.
(#15975) Extract HTTP methods from REST Indirector

There were some useful HTTP methods (http_get, http_post, ...,
http_request) in the Puppet::Indirector::REST class. Most noteworthy
is the http_request method, which provides some useful error
handling so that users get less confusing error messages when something
goes wrong with their certificates / SSL setup.

These methods would be useful in several other places (among them: the
HTTP reports processor and several places in the puppetdb termini), but
prior to this commit it was very difficult (or impossible) to use them
without doing a very confusing dance with unnecessary ruby mixins and
inheritance from classes in the Indirectory hierarchy.

This commit factors these methods out into the new
Puppet::Network::HTTP::Connection class, and tweaks
Puppet::Network::HttpPool to return instances of this new class.

It also refactors the HTTP report processor to use
Puppet::Network::HTTP::Connection.
(#15464) Make Puppet.version settable via Puppet.version=

Without this patch applied the version string of Puppet is dynamically
set from the `git describe` tag in the Rakefile using monkey patching.

This is problematic because this causes a constant to be re-defined
which issues a warning in Ruby.

This patch fixes the problem by implementing the Puppet.version= module
method.  The Rakefile will now set the Puppet version by using `require
'puppet/version'` and calling `Puppet.version = %x{git describe ...}`

Using a module method also has the benefit of making it easier to
intercept and mock Puppet version specific behavior.

From this point forward, the method Puppet.version should but used to
obtain the version string instead of the constant Puppet::PUPPETVERSION.
Merge branch 'ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding' into 2.7.x

* ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding:
  (#15464) Make Puppet.version settable via Puppet.version=
  (#15464) Make Puppet usable as a Gem from source
  Move Puppet version into lib/puppet/version.rb
  (#15464) Make contributing easy via bundle Gemfile
  (Maint) Fix rspec options file
Revert "Merge branch 'ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding' into 2.7.x"

This reverts commit 8919d749c7f5973ab16c7db2b3a64fd1af8bf6b1, reversing
changes made to 97f742d70603f626dc40000aae72c299603282c6.
Merge pull request #1051 from joshcooper/ticket/2.7.x/15693-windows-service

(#15693) Allow windows service restart command to be specified
Merge remote-tracking branch 'upstream/2.7.x' into 3.x

* upstream/2.7.x:
  Revert "Merge branch 'ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding' into 2.7.x"
  (#15464) Make Puppet.version settable via Puppet.version=
  (#15693) Allow restart command to be specified
  (#15464) Make Puppet usable as a Gem from source
  Move Puppet version into lib/puppet/version.rb
  (#15464) Make contributing easy via bundle Gemfile
  (Maint) Fix rspec options file
Merge branch 'refactor/3.x/extract-http' into 3.x

* refactor/3.x/extract-http:
  (#15975) Extract HTTP methods from REST Indirector
Revert "Revert "Merge branch 'ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding' into 2.7.x""

This reverts commit 76ef99b3ea5baeeaa3482d0b3617a1b799c7028c.
(#15464) Exclude gem command from bundler

This patch simply excludes the `gem` command from the dependency
handling of Bundler with the `rubygems-bundler` gem installed.

This patch also updates the README to describe the resolution to the
spec test failures we've been seeing when Puppet contains a Gemfile in
the project root.

To summarize: Use of RVM is considered dangerous

We're able to work around the problem, but the hijacking of shell
builtin commands is a maintenance burden we're not willing to shoulder,
hence RVM being considered a dangerous tool.
Merge branch 'ticket/2.7.x/15464_gemfile_try_2' into 2.7.x

* ticket/2.7.x/15464_gemfile_try_2:
  (#15464) Exclude gem command from bundler
  Revert "Revert "Merge branch 'ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding' into 2.7.x""
Merge branch '2.7.x' into 3.x

* 2.7.x:
  (#15464) Exclude gem command from bundler
  Revert "Revert "Merge branch 'ticket/2.7.x/15464_a_gemfile_would_improve_contributor_on-boarding' into 2.7.x""

Conflicts:
	README_DEVELOPER.md
	lib/puppet.rb
	tasks/rake/gem.rake
(#15547) correct 'pending' values to correct if check for solaris.

Previously, the the pending examples were attempting to skip tests on
Solaris, but were actually skipping tests on all platforms.
Merge branch 'ticket/3.x/15547_correct_pending' into 3.x

* ticket/3.x/15547_correct_pending:
  (#15547) correct 'pending' values to correct if check for solaris.
(#8200) Ensure zonecfg errors are caught

zonecfg can return 0 even though it failed to apply a configuration. We
can catch it only if we check for the output. We now check for
/not allowed/ to verify that the property was applied.

Previously, we were using using `zonecfg -z zone -f -` to read commands
from stdinput and using IO.popen. However, we do not need to do this as
we pass config commands one at a time, and can invoke zonecfg with the
command directly. Hence removed the popen invocation from code for a
simpler exec.
(Maint) Update the test cases to use the 'let'

Changes:
  - updated the invocations to use the new let(:xxx) syntax
  - move each test to method specific contexts
  - ensure that stubbed commands specify arguments (zoneadm)
  - add more tests