Fixes #15 Hiera return nil for false value

The backend would assume that a `false` answer should return the
default, when in fact a false answer would be specifically returned.
After this commit, Hiera should only return the default answer if `nil`
is returned by the backend (for non-existant values).
Merge pull request #10 from hunner/check_resolution_type_error

Add type mismatch error output and test cases
Revising backend bool spec test that nil /= false

If the backend lookup() was requested to return true then it would,
however if it was requested to return `false` or `nil` specifically (both of
which equate to "falsity" in ruby) then it would only respond with
`nil`. This revised spec test would fail previous to this bugfix.
Merge pull request #20 from hunner/issue/15/false_returns_nil

Fixes #15 Hiera return nil for false value
Fixes: Hiera errors on empty yaml files

If a completely empty yaml file is loaded then it will return `false`,
but if a yaml file is loaded with only '---' in it, it returns `nil`.
In either case hiera should handle the cases as expected instead of
erroring. This commit causes these answers to be considered the same as
if the file didn't exist at all.
Test cases for #21

Previously we weren't actually testing *anything* having to do with
*actual* yaml loading. So the previous test cases were writing what we
expected it to be, then checking that it was what we expected.

Using `YAML.load` I am simulating loading actual yaml files for the
tests, which should match the expected return values, not just expected
matching expected.

For the `hiera.yaml` config, we didn't test behaviour if it was missing
or empty.
Merge pull request #21 from hunner/issue/allow_empty_yaml_files

Fixes: Hiera errors on empty yaml files
Do not sort arrays after building them as array data with complex
data in them like hashes will fail to sort and raise exceptions
fix failing test after sort was removed
Fix warnings for rake
Switch branding to Puppet Labs

Modifies the COPYING and Rakefile to brand the Hiera project as Puppet
Labs.

Thanks to RI for the project.

Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
Merge pull request #25 from stahnma/license_mods

Switch branding to Puppet Labs
Merge pull request #24 from hunner/rakefile_update

Fix warnings for rake
Rspec 2.7 has introduced some non backwards compatible changes
that is exposed by using require with full paths.

Simplify the requires to use the ruby lib search order instead
which resolves these
Merge pull request #26 from ripienaar/rspec_version_fix

rspec 2.7 compatiblity fix
Change Rakefile to autoversion

This change modifies the Rakefile to derrive the version of the package
based on a call to "git describe." Also adds a tasks directory for
additions to the Rake tasks.

git describe will show the current annotated tag or the
tag-commits-gSHA1 as the version string. Due to the way gem processes
version strings, the Rakefile replaces '-' with '.' We are also
stripping the gSHA1 portion, as it causes tests failures with alphabetic
characters in the version string. The version number is still uniq based
on the git-describe call.

So, the new release process would be:
  tag (signed), rake default

Future enhancements may add a task for uploads to the puppetlabs
downloads area.

Note: to test I tagged the first commit as 0.0.1.
Other options would be to retag the released versions with signed
tags.

Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
Merge pull request #27 from stahnma/release

Change Rakefile to autoversion
Fixes a quoting string issue

The gsub wasn't always working when the tag wasn't being quoted properly
in the sub inside hiera.rb.  This commit ensures the version is quoted.

It will also strip the leading 'v' from tag to make the version
completely numeric.

Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
Merge pull request #28 from stahnma/release

Fixes a quoting string issue
(maint) Code base cleanup, use 2 space indention.

Before this patch the hiera code base used two different number of
spaces to indent code. In some cases 2 spaces where used, and the rest 4
spaces.

This patch normalizes the number of spaces used for indenting code, and
now uses 2 spaces which is in-line with the Puppetlabs style guide.