Git Product home page Git Product logo

rconfig's Introduction

RConfig

The complete solution for Ruby Configuration Management. RConfig is a Ruby library that manages configuration within Ruby applications. It bridges the gap between yaml, xml, and key/value based properties files, by providing a centralized solution to handle application configuration from one location. It provides the simplicity of hash-based access, that Rubyists have come to know and love, supporting your configuration style of choice, while providing many new features, and an elegant API.

Features

  • Simple, easy to install and use.

  • Supports yaml, xml, and properties files.

  • Yaml and xml files support infinite level of configuration grouping.

  • Properties files support git config-like configuration grouping.

  • Intuitive dot-notation ‘key chaining’ argument access.

  • Simple well-known hash/array based argument access.

  • Implements multilevel caching to reduce disk access.

  • Short-hand access to ‘global’ application configuration, and shell environment.

  • Overlays multiple configuration files to support environment and host-specific configuration.

  • Onload callbacks for single, multiple, or any config file.

Example

 shell/console =>
   export LANG=en

 demo.yml =>
  server:
    address: host.domain.com
    port: 81
  ...

 application.properties =>
   debug_level=verbose
 ...

demo.rb => 
 require 'rconfig'
 RConfig.config_paths = ['$HOME/config', '#{APP_ROOT}/config', '/demo/conf']
 RConfig.demo[:server][:port] => 81
 RConfig.demo.server.address  => 'host.domain.com'

 RConfig[:debug_level] => 'verbose'
 RConfig[:lang] => 'en'
 ...

Requirements

  • Ruby (Developed on 1.8.7)

  • RubyGems (Developed on 1.3.5)

  • activesupport (2.2.2+)

Install

sudo gem install rconfig

ToDo

  1. Finish JSpecs for existing code (Yeah, I know. You’re supposed to right the JSpecs first.)

  2. Create re-factor goals based on Caliper metrics.

  3. Prep for cleaner, stabler release.

Feature Ideas

  • Support for git-like config/properties files (You know, with the namespaced header blocks.).

  • Support for Database-driven configuration.

  • Removing dependency on ActiveSupport (Pull in needed code.).

  • These are features I’m considering. E-mail me <[email protected]> If you like to see a feature added or expedited.

Known Issues

  • None

License

(The MIT License)

Copyright © 2009 Rahmal Conda <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Thanks to everyone I included here. RConfig would not exist without their contributions.

Mike Sandler, Kurt Stephens, CashNetUSA (CNU):

  • Wrote the proprietary class RConfig was originally based on.

rconfig's People

Contributors

rahmal avatar

Stargazers

Alf Mikula avatar

Watchers

Alf Mikula avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.