(maint) Use MatchData object over ruby global vars

The implementation for native file headers for the ParsedFile providers
made use of the Perl style global variables like $`, $', and $&. These
are difficult to understand at first glance and equivalent behavior is
provided by MatchData objects. This commit removes the global variables
with a MatchData object for clarity.
(#14093) Cleanup tests for template functionality

Some of the previous tests were unneeded (check for simple existance) or
mis-named. This cleans those up. A few other tests were trying to
indirectly test many things at once (the ones about access to instance
variables). Instead of the indirect test this splits it into much more
specific tests and statement of behavior.
(#14093) Remove unsafe attributes from TemplateWrapper

The attribute accessor for the :string attribute in the TemplateWrapper
conflicted with a variable being in scope that is named string. The
variable would take precedence and because of the way the
TemplateWrapper accessed the value of the attribute, the variable's
value would be used as the template.

This changes the TemplateWrapper to completely remove :string as an
attribute and only use local variables. This also removes the :file
attribute in favor of a "private"-style naming of the instance variable.
There are no collisions with @__file__ that would cause problems, but
this should reduce the likelihood of them happening in the first place.
(Maint) Remove special handling for symbols in scope

The Puppet::Parser::Scope no longer allows variable names that are not
String objects, so the extra code to handle non-string variable names is
no longer needed.
(#14093) Restore access to the filename in the template

The change to fix certain variables interfering with template evaluation
also removed the accessor method for file. It appears that this is a
mechanism that had been used by others for identifying the name of the
template being evaluated so that they can trace back from a file on a
node to the module and template that created it. This restores that
functionality.
(Maint) Add YARD to TemplateWrapper

This tries to document the methods that should be available to template
authors. Not all methods are listed, since there may be some things that
are mixed in somehow and there are all of the variable accesses provided
via method_missing.
(maint) Kill Puppet::Parser::TemplateWrapper#scope=

This is dead code that is never called based on `ack` and replacing the
method body with an thrown exception.  The scope instance var is stored
in @__scope__ not @scope.
(maint) Add some YARD to Puppet::Forge
(#19409) Raise Puppet::Forge::Errors::ForgeError on bad HTTP response from forge

When a bad HTTP response indicating an error, or an "error" string in the
response is received from the forge, raise Puppet::Forge::Errors::ForgeError
subclases rather than RuntimeErrors.

This allows the error to be caught by the module face and the error rendered
appropriately, i.e. as JSON if requested by the user.  Else fallback code for
unhandled exceptions is used, causing the exception to only be written via
logging.
(#16553) Exclude portmap-wait from upstart services

The portmap-wait upstart service is not a service by itself (it's a helper for
the portmap service) and does not respond to the status command, it returns 1
along with an error message. This commit adds portmap-wait to the excludes
method of the init provider, which is also used by the upstart provider to
exclude services from self.instances. This also adds the portmap-wait service
to the upstart provider spec test to verify that it is correctly excluded from
self.instances.
(maint) Remove rc_mocks from build_defaults

Packaging internals have been updated to no longer require rc_mocks, so this
commit removes the rc_mocks from the build_defaults.
(maint) Add f18 mocks to build_defaults

Fedora 18 has been released to the world, so we should build packages for it.
This commit adds the fedora 18 mocks to the build_defaults so we can easily
supply fedora 18 packages.
(maint) Parse PMT JSON output when testing

JSON hash structures are unordered and when testing the output of the
puppet module tool the output was assumed to be ordered. This commit
extracts the outputted JSON and converts it into a Ruby data structure
and performs checks on the data elements to ensure the output is
correct.
Refactor the ParsedFile provider unit test

The initial implementation of the unit tests for a simple provider
inheriting ParsedFile was imperfect and full of repitition. The
restructuring makes the code reflect the semantics a lot better.

Based on suggestions from Adrien Thebo.
(maint) Refactor parsedfile specs to remove instance vars

The current test coverage for the ParsedFile provider uses an instance
variable referencing the class. This commit removes the instance
variable use and replaces them by setting `subject` to an anonymous
subclass of ParsedFile.
(maint) convert parsedfile helpers to let blocks

This commit replaces the use of instance variables with `let` blocks in
the parsedfile provider specs.
(maint) Update rubygems source to use https

This gets ride of the warning with Bundler 1.3.0:

    The source :rubygems is deprecated because HTTP requests are
    insecure.
    Please change your source to 'https://rubygems.org' ...
(#18092) Use CGI.parse on network URI query

The current implementation of the network device enable password parsing
is unable to handle characters like sharps and spaces in the password,
which are valid passwords. This commit adds CGI parsing of the query
string to only extract and unescape the enable query parameter.

This supercedes GH-1327 and GH-1491.
(#17864) Don't check certificate_revocation if configured not to
(maint) Refactor ssl/host_spec.rb crl context

The tests added in 81a5cbb added more checks around the
certificate_revocation setting and overrided the local context settings.
This commit splits the rspec context into two smaller contexts for each
possible case and sets values in the before block accordingly.