cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Fix checking for unknown options in Configuration #212

Open dominikh opened 8 years ago

dominikh commented 8 years ago

In #[] and #[]= we check against a list of known options and raise an exception for unknown options. We assumed that OpenStruct#method_missing would use these methods, but it doesn't. It accesses the data directly. We should either stop using OpenStruct so that we can implement our checks, or we should discard the checks.

The majority of people never experienced the checks, and nobody complained and asked for checks to be added yet, so the use of the checks is questionable at best.

If we do fix the checks, we need to make sure that KnownOptions is correct for all configs. At least :mode for the bot's configuration is missing.