Enviable

Enviable is a small collection of functions and delegates that makes working with operating system environment functions a little easier. It exists for two reasons:

Delegates are defined for System.delete_env/1, System.fetch_env/1, System.fetch_env!/1, System.get_env/0, System.get_env/2, System.put_env/1, and System.put_env/2.

Usage

This will typically be used in config/*.exs files alongside Dotenvy or similar configuration tools based around environment variables.

# config/runtime.exs
include Config
include Enviable
client = fetch_env!("CLIENT")
Dotenvy.source([".env", ".env.#{client}", System.get_env()])
config :my_app,
key: fetch_env!("SECRET_KEY"),
port: fetch_env_integer!("PORT"),
ssl: fetch_env_boolean!("SSL_ENABLED")
# config/dev.exs
include Config
Enviable.put_env_new("SSL_ENABLED", false)

Installation

Enviable can be installed by adding enviable to your list of dependencies in mix.exs:

def deps do
[
{:enviable, "~> 0.1.0"}
]
end

Documentation is found on HexDocs.

Semantic Versioning

Enviable uses a Semantic Versioning scheme with one significant change: