teaminsight/ns-options — pull request #41 by kellyredding (2012-05-18 14:27:31+00:00)
Title: Proxy options

This is a set of updates related to the Proxy behavior and handling

### Declarative Proxying
Before, ns-options would proxy using only a `method_missing` approach. This causes problems with classes has methods injected on them that nullify the `method_missing`. For example when Rake injects a `namespace` method. This change models the proxy more closely follow the `Namespace` class. Known methods a declaratively proxied and `method_missing` is only used when it would be used for the namespace itself (dynamic defining of options).

### Less Verbose definition syntax
Changed to make option definition more succinct:
* `opts` for `options`
* `opt` for `option`
* `ns` for `namespace`

Applied to the main `Options` and `Namespace` classes as well as the `Proxy` mixin

### Cleaned Up how Proxy is mixed in
Before, when mixing in the Proxy, it would mixin the main NsOptions module for you. This had some unintended side-effects (such as mixing in an `options` method to the proxy). I changed it so that mixing in the Proxy only adds in the proxied methods but defines the proxied `NAMESPACE` in the same way normal root level options are defined. This involved commonizing that logic in a helper.

Also, before the Proxy would mixin proxy instance methods with included on a Module. This is unnecessary so I change it to only mixin instance methods when included on Classes.

### README and Comment additions and cleanups
I added README docs for the less verbose syntax and embellished on some comments some