[ANN] ruby-configurable

I’ve just released ruby-configurable 1.0.1, a library that gives any
plain Ruby class a configuration object.

Code:
https://bitbucket.org/krbullock/configurable (Hg repo)
https://github.com/krbullock/configurable (Git mirror—thanks hg-git!)

Documentation:
http://handtools.rubyforge.org/ruby-configurable/

Why this implementation?

  • Provides a simple class macro to declare allowed settings and their
    default values.
  • Settings are accessible via simple method calls, or array-style or
    hash-style.
  • Unknown configuration keys are rejected.
  • Handles nested configuration keys (e.g. MyClass.config.foo.bar =
    :baz).
  • Convertible to a hash-argument-friendly form, for passing to methods
    that take ‘keyword’ arguments.
  • No dependencies outside core Ruby.

Current known shortcomings:

  • Doesn’t separate configuration of a subclass from that of its
    superclass.
  • No way to programmatically add allowed settings after the initial
    declaration.

Oh, and I forgot to mention, to install:

$ gem install ruby-configurable

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs