Recently I was writing a simple program (more a script than a full-fledged program) to report the number of commits for each dev on all repos owned by a given organization.
Following the will to develop something extensible I set up a CLI tool (actually a gem) based on the famous gem Thor.
In order to have full power to configure my gem I choose to rely on another gem called configuration.
As stated inside its README it
provides a unified approach to do configurations using the
MyGem.configure do ... endidiom…
Likewise the latter two implementations, the configuration gem also grants the possibility to configure your gem by passing an hash. This is accomplished by using its
This is particularly useful when you need to create a configuration composed by a set of a priori unknown keys.
There is however something to take into consideration if you need to use this feature. Before version
from_h method doesn’t work with hashes composed by string keys. It only works with symbol keys.
I discovered this issue while trying to set up a dynamic configuration and thanks to the creator of the configuration gem the “problem” was successfully solved as stated by this issue.
So now, happy configuration to everyone! 😛