Sha256: dc19fb7033ddf17af32806310e90e34e93cb65131ef9229524d45ad58dad94b0

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 KB

Contents

# Figleaf
[![Build Status](https://secure.travis-ci.org/challengepost/figleaf.png?branch=master)](http://travis-ci.org/challengepost/figleaf)


YAML based DRY settings manager.

The YAML expansion functionality came about by our getting tired of having to
create a YAML file and then create an initializer that would expand such file
and include in our applications.

## Installation

Add this line to your application's Gemfile:

    gem 'figleaf'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install figleaf

## Usage

In `application.rb`:

```
Figleaf::Settings.configure_with_auto_define do |s|
  s.env = Rails.env
  s.some_awesome_flag = true
  s.load_settings
end
```
Then, you can override any particular setting inside your environments/*.rb
files.

eg: In `production.rb`
```
Figleaf::Settings.configure do |s|
  s.some_awesome_flag = false
end
```
etc...

Also, it provides the ability for you to define all your environment dependent
settings in just one YAML file inside `config/settings/`. The anatomy of these
files should be:

```
development:
  foo: bar

test:
  foo: flob

production:
  foo: foo
```

The Figleaf::Settings parser will create a namespace for your YAML file after the file
name.

Then, assuming that you named your YAML file `mysetting.yml`. you can just
access `foo` as `Figleaf::Settings.mysetting["foo"]`. (Inspired by Rails' `database.yml`,
of course.)

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
figleaf-0.0.3 README.md
figleaf-0.0.2 README.md