[ANN] ruby-configurable

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

https://bitbucket.org/krbullock/configurable (Hg repo)
GitHub - krbullock/configurable: Make your Ruby class or app configurable with a simple mixin. (Git mirror—thanks hg-git!)


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
  • Unknown configuration keys are rejected.
  • Handles nested configuration keys (e.g. MyClass.config.foo.bar =
  • 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
  • No way to programmatically add allowed settings after the initial

Oh, and I forgot to mention, to install:

$ gem install ruby-configurable