File-based configuration management

What we're going to do is to put all of our configurations into a file and load them from the file when we start our app. This is quite simple to get started with, but we'll have to evolve in order to support some important basic needs. We'll start with a config file, which we'll name .env, which is a commonly used convention, although the name is actually not important. Here are the contents of the file:

TODO_STORE='redis'
REDIS_URL='redis://127.0.0.1:6379/0'
REDIS_PASSWORD='cantguessthis'

The format is that of variable declarations in a Bash shell script. This is appropriate because using environment variables will force us to use Bash variables in the end. We avoid the confusion of type conversions by declaring ...

Get RSpec Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.