README.md

confstruct

Confstruct is yet another configuration gem. Definable and configurable by
hash, struct, or block, confstruct aims to provide the flexibility to do things your
way, while keeping things simple and intuitive.

# Confstruct::ConfigClass with no parentheses will be treated as a
# constant, not a method. In block form, use either Confstruct.ConfigClass
# or Confstruct::ConfigClass()
MyConfigClass = Confstruct.ConfigClass do
project 'confstruct'
github do
url 'http://www.github.com/mbklein/confstruct'
branch 'master'
end
end
config = MyConfigClass.new

Notes

Confstruct will attempt to use ordered hashes internally when available.

In Ruby 1.9 and above, this is automatic.

In Rubies earlier than 1.9, Confstruct will try to require and use ActiveSupport::OrderedHash,
falling back to a regular Hash if necessary. The class/instance method ordered? can be used
to determine if the hash ordered or not.

In order to support struct access, all hash keys are converted to symbols, and are accessible
both as strings and symbols (like a HashWithIndifferentAccess). In other words, config['foo']
and config[:foo] refer to the same value.

Release History

Contributing to confstruct

Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet

Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it

Fork the project

Start a feature/bugfix branch

Commit and push until you are happy with your contribution

Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.