jillesvangurp / property-configuration-rb

Simple solution for loading configuration from property files in Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

properties-configuration-rb

Simple solution that allows you to define properties in code and override them using properties files. The default values are defined in your ruby code as a simple hash. You access the properties via members of the config object.

Combining this project with my DIY dependency injection project or something similar is a good way to manage application wide configuration in an easy way. I use this as part of my application definition module and inject the configuration wherever I need it.

Install

gem install properties-configuration

Usage

require 'properties_configuration'

config=PropertiesConfiguration::loadConfiguration({
  :my_property => 'value'
},['/etc/my.properties', '/etc/more.properties'])

puts config.my_property

License

This code is licensed under the expat license. See the LICENSE file for details.

About

Simple solution for loading configuration from property files in Ruby

License:MIT License


Languages

Language:Ruby 100.0%