puppetlabs/hiera — pull request #46 by kelseyhightower (2012-05-01 16:23:57+00:00)
Title: (#14256) Adding save API

This patch adds a new API for saving data by delegating to a specific
backend. The backend is responsible for saving data based on a key,
value, and source. The backend must return a status response of true
or false depending on the success or failure of the save operation.

Example:

If we have the following Hiera configuration:

:hierarchy:
- %{environment}
- common

:backends:
- backend_with_save_support

We can save data to the `backend_with_save_support` like this:

require 'hiera'

hiera = Hiera.new
status = hiera.save('key, 'value', 'backend_with_save_support', 'common')

This patch includes tests.