Project

envyml

0.0
No commit activity in last 3 years
No release in over 3 years
load env yaml file into ENV
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.14
~> 5.0
~> 10.0
 Project Readme

Envyml Build Status

Loads environment YAML file into ENV ruby hash. Minimalistic approach. The goal is to keep less than 50 LOC forever.

Installation

Add this line to your application's Gemfile:

gem 'envyml'

And then execute:

$ bundle

Or install it yourself as:

$ gem install envyml

Usage

Create file YOUR_PROJECT/config/env.yml, with:

  key: VALUE

Call Envyml.load to insert this file into ENV ruby hash. Don't forget to add config/env.yml to gitignore!

Rails

If you are using Rails or just wants to separate your keys, add environment sections to your file:

  development:
    FOO: bar
    KEY: value

  test:
    FOO: bar
    KEY: value

Custom calls

You can customize filename, hardcode environment and much more. Check /lib/envyml.rb to understand your options.

  Envyml.load('lib/my_file.yml', 'test')
  Envyml.load('lib/my_file.yml')

If you use Rails, but wish to force use without environments

  Envyml.load('lib/my_file.yml', false)

Testing and Contributing

Make sure the tests are passing: rake test Feel free to send pull requests

License

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