Project

envforcer

0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Storing configuration in the environment is one of the tenets of a twelve-factor app. However, problems arise when required environment variables aren't set.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 0
~> 4.2.1
~> 10.0

Runtime

>= 0
 Project Readme

Envforcer Build Status Gem Version

Enforce environment variable requirements.

Storing configuration in the environment is one of the tenets of a twelve-factor app. However, problems arise when required environment variables aren't set.

Usage

Add your required ENV keys to .envforcer.yml:

- REQUIRED_KEY1
- REQUIRED_KEY2
- REQUIRED_KEY3

When the app starts, envforcer will check that all the required variables are set, and raise an error if they are not. This will prevent the app from starting.

Note: Currently only tested with Heroku. Will cause push to be rejected.

Installation

Rails

Add this line to your application's Gemfile:

gem 'envforcer', require: 'envforcer-rails'

And then execute:

$ bundle

This will add a Railtie to enforce environment variables after_initialize.

Other Frameworks

At the time you wish to enforce the environment variables, add the line:

Envforcer.enforce

Contributing

We welcome pull requests. Please make sure tests accompany any PRs.


Curated by the good people at MojoTech.

(psst, we're hiring)