DotConfig 
This gem is only compatible with Ruby 1.9.
The DotConfig gem give you access to your configuration via the dot syntax. You instantiate DotConfig::Configuration with a Hash and you will retrieve the values in calling the key as method name.
Installation
Add this line to your application's Gemfile:
gem 'dot_config'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dot_config
Usage
app_config = DotConfig.new(language: 'Ruby', framework: 'Ruby on Rails')
app_config.language
app_config.framework
app_config.version
app_config = DotConfig::Configuration.new(config: { language: 'Ruby', framework: 'Ruby on Rails' })
app_config = DotConfig::Configuration.new
app_config.config = { language: 'Ruby', framework: 'Ruby on Rails' }
app_config = DotConfig.new('PATH/TO/YOUR/FILE.yml')
app_config = DotConfig.new(language: { ruby: 'Ruby on Rails' })
app_config.language
app_config.language.ruby
app_config = DotConfig.new({ language: 'Ruby', framework: 'Ruby on Rails' }, true)
app_config = DotConfig.new(true)
app_config.config = { language: 'Ruby', framework: 'Ruby on Rails' }
app_config.language
app_config.language = 'Python'
app_config.language
app_config = DotConfig.new(language: { ruby: 'Ruby on Rails' })
app_config.to_hash
Documentation
To get more information about this gem, please visit RubyDoc.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request