Closed seanredmond closed 10 years ago
Cheers Sean. I'm going to sit on this for a bit while I try and remember why I was so explicit about never falling back to the Yaml for any required vars that weren't defined. I left myself a fairly big clue (in how I wrote the code and tests) that I did it that way on purpose. I suspect it'll have been something to do with hosting on services like Heroku (which is why env var support was added in the first place), but I'll see if it comes back to me…
If other people flag this as being an issue in future we can look at it again, but right now there are more important things to do so I'm going to close this. I'm still not convinced there's a strong argument either way, so I'm afraid I'm taking the shortest path (the docs would need fixing too, for example) and I'm happy with the current behaviour.
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:
TypeError
to be raised when nesta tries to use anil
value, expecting a string. The code in config.rb looks as if the intent was to pass theErrno::ENOENT
that gets raised whenYAML::load
tries to open the non-existent file. Now theErrno::ENOENT
is passed on.#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 looks as if the intent was in fact to raise an error.