(#17434) Revert "Merge pull request #29 from timurbatyrshin/puppet-style"

This reverts commit b48694063d890b821928cf578defff1d70084845, reversing
changes made to 422c386f36980d5e080666ec0d12137ad0bc7ba9.

This change caused top scoped lookups (eg "%{::var}") to be retrieved from a
local scope.

Conflicts:
	lib/hiera/backend.rb
(#17434) Add YARD for #parse_string
(#17434) Clarify tests for #parse_string
(#17434) Add tests to exclude unwanted lookups

The changes made in GH-29 (commit 3ec4165) caused a sequence of unwanted
lookups to occur. It was originally conceived as a way to get rid of
deprecation warnings that puppet was issuing (incorrectly issuing) when
looking up facts without preceeding the lookup with ::. The change,
however, also had the effect that if a variable contained :: and did not
exist, then hiera would end up in an infinite loop trying to resolve the
interpolation.

This adds tests to assert that we don't try to do that kind of "smart"
lookup by trying to clarify that the lookup is simply on exactly what is
contained inside the %{} inside the string.
(#17434) Stronger assertion about how keys are looked up

It turns out that the current behavior is that even whitespace is
significant when looking up a value for string interpolation. This adds
a test for that case.
(Maint) Describe desired behavior in backend specs

The names used for the previous tests of the Backend code were very
tightly tied to the implementation and did very little to describe the
desired behavior. This tries to reword them in a manner that makes the
behavior that is expected more clear. It also removes the constant use
of the word "should" in favor of more specific and active verbs.
(#17434) Simplify string interpolation

The previous implementation for string interpolation was hard to follow
and see what was being done. This replaces it with an implementation
that relies entirely on gsub.
(#17434) Simplify logic around looking up values

This inverts the if statement used for looking in the scope or the
extra_data. At the same time it uncovered a bug, and fixes it, whereby
if the extra_data contained boolean false, it would be ignored. The new
behavior is that a false value in the extra_data is used rather than
changed to nil.
(#17434) Support recursive interpolation

The original code for interpolation had, hidden somewhere in its depths,
supported recursive expansion of interpolations. This adds that support
back in.
(#17434) Detect loops in recursive lookup

The recursive lookup functionality was vulnerable to infinite recursion
when the values ended up referring to each other. This keeps track of
the names that have been seen in order to stop a loop from occuring. The
behavior for this was extracted to a class so that it didn't clutter the
logic of variable interpolation. The extracted class also specifically
pushes and pops on an internal array in order to limit the amount of
garbage created during these operations. This modification should be
safe so long a new Hiera::RecursiveLookup is used for every parse that
is done and it doesn't get shared in any manner.
Merge pull request #116 from zaphod42/issue/1.x/17434-parse-string-top-scope

(#17434) Do not fall back to different lookups
Merge branch '1.x'

Conflicts:
	lib/hiera/backend.rb