<commit_before># Chamber [![Build Status](https://travis-ci.org/stevenhallen/chamber.png)](https://travis-ci.org/stevenhallen/chamber) [![Code Climate](https://codeclimate.com/github/stevenhallen/chamber.png)](https://codeclimate.com/github/stevenhallen/chamber)

Chamber lets you source your Settings from an arbitrary number of YAML files and
provides a simple mechanism for overriding settings from the ENV, which is
friendly to how Heroku addons work.

## Installation

Add this line to your application's Gemfile:

    gem 'chamber'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install chamber

## Usage

The following instructions are for a Rails app hosted on heroku with both
staging and production heroku environments.

Create a Settings class that extends Chamber in `app/models/settings.rb`:

```ruby
class Settings
  extend Chamber
end
```

Create a `config/settings.yml` that has this structure:

```yml
# specify environment your Rails app is running in
development:
  #In development, we manually set the value to the variable we'll use
  # Settings.REDIS_TO_GO -> returns the URL
  REDIS_TO_GO: "redis://root@localhost:6379"

production:
  #In production, on Heroku, for example
  # Settings.REDIS_TO_GO -> looks for the variable in the ENV and returns its value
  REDIS_TO_GO:<commit_msg>Fix spacing for chamber.yml example<commit_after># Chamber [![Build Status](https://travis-ci.org/stevenhallen/chamber.png)](https://travis-ci.org/stevenhallen/chamber) [![Code Climate](https://codeclimate.com/github/stevenhallen/chamber.png)](https://codeclimate.com/github/stevenhallen/chamber)

Chamber lets you source your Settings from an arbitrary number of YAML files and
provides a simple mechanism for overriding settings from the ENV, which is
friendly to how Heroku addons work.

## Installation

Add this line to your application's Gemfile:

    gem 'chamber'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install chamber

## Usage

The following instructions are for a Rails app hosted on heroku with both
staging and production heroku environments.

Create a Settings class that extends Chamber in `app/models/settings.rb`:

```ruby
class Settings
  extend Chamber
end
```

Create a `config/settings.yml` that has this structure:

```yml
# specify environment your Rails app is running in
development:
  # In development, we manually set the value to the variable we'll use
  # Settings.REDIS_TO_GO -> returns the URL
  REDIS_TO_GO: "redis://root@localhost:6379"

production:
  # In production, on Heroku, for example
  # Settings.REDIS_TO_GO -> looks for the variable in the ENV and returns its value
  REDIS_TO_GO:
{'fraction_non_alphanumeric': 0.08444940476190477, 'fraction_numerical': 0.002976190476190476, 'mean_word_length': 4.555785123966942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '845416', 'n_tokens_mistral': 827, 'n_tokens_neox': 776, 'n_words': 301}