Project

figs

0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Simple app configuration using ENV and YAML files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7
~> 3.5

Runtime

~> 1.2
>= 10.1
 Project Readme

Figs

Gem Version Build Status Code Climate Coverage Status Dependency Status

Railsless, herokuless, configurable, barebones figaro with a knack of using git repos for configuration files.

Simple app configuration

What is this for?

Figs is for configuring apps, especially open source apps, much like Figaro. Whereas Figaro is great in that it works seamlessly with Rails 3 and 4, Figs also works with non Rails apps providing the same great ENV support, although in a slightly different way.

However, much like Figaro, Figs allows you to Open Source your app while keeping private things private.

How does it work?

Figs is identical to Figaro in every way barring a few key differences. It uses ENV to store any string key-value pairs. However, sometimes its necessary to store more complex objects, such as arrays. ENV doesn't allow for objects, so we provide a souped-up wrapper called Figs::Env for this purpose! All keys are converted to strings and all non-string values are marshalled and stored in ENV, you can demarshall them yourself using ENV or rely on Figs::Env.key_name to do it fast and easy!

Example.

Add Figs to your Gemfile then bundle command to install it:

gem "figs"

Then you'll have to figsify your project so Figs can find where you keep your environment variables. If a location is not specified, a template will be created in the root directory as application.yml.

figsify

or

figsify config/settings1.yml config/settings2.yml config/settings3.yml

And finally

figsify git@github.com:GITHUBNAME/REPONAME.git filename1.yml config/filename2.yml

Now Figs will know where to find your environment vars!

IMPORTANT: The order in which you load your files matters, as the environment variables perform a merge on the hashes, the right hand arguments taking precedence.

Then in ruby

Figs.load()

Settings.secret = ENV["SECRET"]
# OR
Settings.servers = Figs.env["server"]

Thank you!

Figs was made possible by the kind folks at Figaro