Project

envy

0.0
No commit activity in last 3 years
No release in over 3 years
A gem that creates the illusion of namespaced env variables
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

ENVY

Envy allows you to use namespaced environment variables, simply by defining environment variables with a common prefix.

For instance, let's say you have:


	
EC2_ACCESS_KEY='abcdefg'

EC2_SECRET_KEY='0123456789'

CAMPFIRE_API_TOKEN='zyxwvutsr'

CAMPFIRE_SUBDOMAIN='SOULCOMPRANCER'


Envy lets you do...



require 'envy'

Envy.namespace(:ec2, :campfire)

puts CAMPFIRE

# {:api_token => 'zyxwvutsr', :subdomain => 'SOULCOMPRANCER'}

puts Envy::EC2[:access_key]  

# 'abcdefg'



Envy will try to define a global constant (EC2), but will also always define a constant within the Envy module (Envy::EC2), in case some sort of conflict prevents the global constant from working properly.