(#2437) Prepare tests that illustrate the issue

This patch takes the 3 examples provided in the issue description and
ensure that they fail when needed. It will help fixing the issue.
(#2437) Fix the first invocation of the class having bad parameters types

The first type we use Nagios::Base with a particular type, the method for
the parameters assignemtn are not present yet ; and it creates a side-
effect of changing the type of the parameters to Array.
It did break the rspec tests.
(#2437) Complete the tests to detect a variety of edge cases
(#2437) Escape semicolon (;) when writing Nagios configuration files

In nagios configuration files, semicolon (;) indicates a comment, except
when it is escaped with a backslash (\).
If we output a value with an unescaped semicolon, it will be considered
as a comment by Nagios, also by Nagios::Parser and thus the part
after the semicolon, included, will be lost.
Escaping the semicolon ensures it will be taken into account by
both Nagios and Nagios::Parser.
Cf http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html
Cf xodtemplate.c in Nagios sources
(#2437) Fix the parser : comments, semicolon, ...

Lots of tightly coupled things here :
- The rules were modified to take care of an existing issue
that prevented to have full line comments (Starts with #) or
carriage returns just after a curly brace definition.
- The lexer was modified to consider an inline comment only
when a semicolon is not preceded by a backslash.
When a semicolon IS preceded by a backslash, it is considered
as escaped and is preserved (the escaping backslash is removed)
- The lexer was modified to allow pound (#) at every position
in a line (except the first character, which denotes a full
line comment)

Cf xodtemplate.c in Nagios source
(#2437) Compile the parser to ruby code

Parser is compiled with racc-1.4.9 while it was previously
compiled with racc-1.4.5 ; this causes a lot of cosmetic
changes and diffs.
(#2437) Comments can start with a pound (#) anywhere on an empty line

Nagios allows comments to start with a pound (#) anywhere on the line
if there are only spaces and/or tabs before.
This commit adds a test case for this, and fixes the parser accordingly.
(#2437) Prefer StringScanner in lexer (performance)

The lexer was previously doing multiple string manipulations.
My previous commits fixed the lexer, but introduced a 6x time
penalty compared to the original lexer, which was hard to remove.
Using StringScanner instead of strings substitutions is even
faster than the original lexer.
(#2437) Parser now using StringScanner in lexer (performance)
(#2437) Cosmetic changes for the tests
(#2437) Regex compatibility with Ruby 1.8.x

In the previous commits I was using negative lookbehind, which
are only available in Ruby 1.9+.
Rewritten using a different logic which now works on both versions
of Ruby
(#2437) For ruby 1.9, always consider input text as ASCII
(#21198) Allow data bindings w/ hiera to get special vars

Hiera functions get several extra variables that are often used during
classification. The hiera data bindings didn't provide these same
variables and so transitioning from functions to data bindings was
impossible at times. This changes data bindings to pass the whole scope
through (the only way to produce the calling_class and module) and then
wraps it in the Hiera::Scope object to make the variables available.

This replaces an acceptance test with an integration test that checks
the same functionality, but without needing to run an entire machine to
check it.
(Maint) Translate acceptance test to integration

We can make the same check much faster by converting this check to an
integration test.
fixed sendmail

Sendmail usage lacked a blank line after "To:" field. Which sometimes caused blank emails being sent.
(Maint) Remove unused example manifests

These manifests seem to have been created when some various issues were
fixed and functionality was added. However, they are not a comprehensive
(nor updated) example of how to use puppet. Keeping them here probably
ends up being a distraction for those who find them.
(Maint) Update commands to use new forms in hiera examples

The hiera examples were written assuming that puppet apply was just
puppet (the old form), and that hiera was not always available (and so
set the libdir).
(#2437) Fix the odd test failure

As I'm not fluent in rspec I did introduce some errors in the test,
which were not failing for me but did for others.
I slightly rewrote the test case, putting in constants the
test case (instead of instance variables in a before hook) so
now I can iterate one 'it' test.
Merge remote-tracking branch 'upstream/master' into fix/master/2437-nagios_with_semicolon

Conflicts:
	lib/puppet/external/nagios/base.rb
	lib/puppet/external/nagios/grammar.ry
	lib/puppet/external/nagios/parser.rb
(#7911) Fixed exception when using forcelocal param

When the user resources had forcelocal set to true the provider would throw the error "undefined method `intern'".  This was because the gid method was being passed to a should call rather than a symbol.  Arguments passed to should need to be symbols.