gma/nesta — pull request #134 by seanredmond (2013-02-18 23:08:27+00:00)
Title: Let environment variables override settings in config.yml

This is a fix for issue #133 and allows you to override individual configuration settings with environment variables without having to override them all. This allowed a simplification of the logic around checking for a config file and has a couple of side effects:

1. Currently a missing config file causes a `TypeError` to be raised when nesta tries to use a `nil` value, expecting a string. The [code in config.rb](https://github.com/gma/nesta/blob/master/lib/nesta/config.rb#L77) looks as if the intent was to pass the `Errno::ENOENT` that gets raised when `YAML::load` tries to open the non-existent file. Now the `Errno::ENOENT` is passed on.

2. I happened to have a page where there was no blank line between the metadata and the `#heading`. This is an invalid format, and with these changes loading that file raises an error because no heading is found. Without these changes, however, the page loads, just with a blank heading. The [code in models.rb](https://github.com/gma/nesta/blob/master/lib/nesta/models.rb#L220) looks as if the intent was in fact to raise an error.