No commit activity in last 3 years
No release in over 3 years
A library that makes environment dependent configuration easy in rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 2.3.0
 Project Readme

environment_configurable

Description

A library that makes environment dependent configuration easy in rails.

Rationale

Environment dependent configuration is a common problem in rails, and we noticed a common pattern:

  • We tend to extract configuration variables to a yaml file
  • We often wrap the yaml configuration in a configuration helper

Environment Configurable accomplishes both of these task succinctly.

Install

  • gem install environment_configurable
  • Add config.gem "environment_configurable" to your environment.rb file

Dependencies

  • Rails 2.3.0 >=

Example

class S3Helper
  include EnvironmentConfigurable
  configure_with "config/s3.yml"
  
  def self.connect!
     AWS::S3::Base.establish_connection!(
        :access_key_id     => config.access_key_id,
        :secret_access_key => config.secret_access_key
      )
  end
end

s3.yml

production: &DEFAULTS
  access_key_id: ACCESS_KEY_ID
  secret_access_key: SECRET_ACCESS_KEY
  bucket: the-prod-bucket

staging:
  <<: *DEFAULTS
  bucket: the-staging-bucket

development:
  <<: *DEFAULTS
  bucket: the-development-bucket

test:
  <<: *DEFAULTS
  bucket: the-test-bucket

Authors