0.0
No commit activity in last 3 years
No release in over 3 years
E. E. Cummings manages your ENV variables and gives you clear warnings when they are misconfigured.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 0
 Project Readme

E. E. Cummings

A tool to validate your environment variables

Description

E. E. Cummings manages your ENV variables and gives you clear warnings when they are misconfigured.

Installation

gem install ee_cummings

or add the following to a Gemfile

gem 'ee_cummings'

Usage

require 'ee_cummings'

# list your environment variables
EECummings.configure do |c|

  # register an environment variable to require
  c.variable do |var|
  
    # the environment variable name
    var.name = 'API_KEY'
    
    # a regular expression that the value of the
    # variable must match
    var.regex = /[a-zA-Z0-9]+/
  end
  
  # register another varialbe
  c.variable do |var|
    var.name = 'API_SECRET'
    # regex is defaulted to /.*/
  end
end

# to retrieve the values of the environment variables
EECummings.api_secret
EECummings.api_key

Notes

If you are using this gem on a rails app deployed to heroku, asset compilation will fail as ENV variables are not accessible while the assets are compiled. A work around for this is to enable an experimental feature of heroku for your app which exposes the variables during asset compliation.

heroku labs:enable user-env-compile