Giter VIP home page Giter VIP logo

fig's Introduction

Fig

Build Status

Fig is a library for standardizing the configuration of a ruby application. This was specifically written with Rails in mind, but is not limited to that framework. The intent is to ensure that all configuration for an application is loaded from the environment, per 12 factor design. It is a wrapper around the popular Figaro configuration library.

The possible values that can be set via Fig are configured in two files: a paramaters file and a defaults file (see the files in spec/data for an example). The values in the parameters file specify all of the possible fields that can be configured and their associated types. The values in the defaults file are a subset of the fields in the parameters file, specifying default values for configuration fields if they are not set in the environment. This means that fields in the defaults file are optional, while fields not included are required to be set by the environment.

When the application is loading, you instantiate your configuration by calling:

# Assign to a global
CONFIG = Fig::Config.new('params.yml', 'defaults.yml', 'application.yml', 'MYAPP')

The final argument is a prefix with which all environment variable are expected to be prefixed.

Before the rest of your app makes use of the configuration, it should be locked (though it may make sense to modify it in flight during initialization before locking it): CONFIG.lock

fig's People

Contributors

mbeasley avatar caltman avatar

Watchers

 avatar  avatar James Cloos avatar  avatar  avatar  avatar

Forkers

mbeasley nevinera

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.