Simplifies repetitive work of parsing configuration files
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.md
Rakefile
config_man.gemspec

README.md

ConfigMan

ConfigMan is a simple library, without external dependencies, to load config files and expose an interface on top of them.

How to Use

Let's say for example we have this yaml config file:

  foo:
    bar:
      baz: qux
    barbar: [1,2,3]
    bazbaz:
      foofoo:
        barbar: qux

We can load it like this:

config = ConfigMan::Loader.new('config/config.yml')
config.foo.bar.baz # "qux"
config.foo.barbar # [1,2,3]
config.foo.bazbaz.foofoo.barbar # "qux"

Instead of acessing it directly, we can also export as a hash:

config.foo.to_hash # {bar: {baz: "qux"}, barbar: [1,2,3], ...}