Project

envm

0.0
No commit activity in last 3 years
No release in over 3 years
Manage environment variables within your Ruby project
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
~> 3.3.0
 Project Readme

Envm

Manage environment variables within your Ruby project

Installation

Add this line to your application's Gemfile:

gem 'envm', github: "teespring/envm"

And then execute:

$ bundle

Or install it yourself as:

$ gem install envm

Usage

require 'envm'

# Configure the environment variable manifest file
# Supported formats: YML
Envm::Config.manifest_path = File.join(Rails.root, "config", "env.yml")

# you'll have to manually call setup
Envm.setup

# Access allowed environment varables
Envm["DATABASE_URL"]
#=> "mysql2://root@localhost:3306/teespring_dev"

# Access disallowed environment varables
Envm["DATABASE_URLX"]
#=> fail Envm::EnvVarNotFoundError, "DATABASE_URLX was not found"

# Access environment varables using Ruby's ENV
ENV["DATABASE_URL"]
# => STDERR.puts "Warning: deprecated usage of ENV with value 'DATABASE_URL'"

License

The gem is available as open source under the terms of the MIT License.