mattjalexander/chef-collectd — pull request #4 by darxriggs (2013-12-26 17:22:13+00:00)
Title:  fixed capitalization in collectd_key method

The method has been changed multiple times in the past.

The question is: What's the expected behaviour with the least surprise for the user?

Brainstorming:

a) No matter what (Symbol or String), the generated key should be the same. (This was different in the past.)
b) If the key is specified with underscores, it should be transformed to camel-case.
c) If the key is specified with camel-case, it should be used as is.

So how to detect in which format the key was specified and what transformation to use?

Possible combinations of underscores and upper case letters:

option value | underscores? | upper case letters? | generated key
'optionab' | no | no | Optionab
'OptionAB' | no | yes | OptionAB
'option_a_b' | yes | no | OptionAB
'Option_AB' | yes | yes | OptionAb + WARN message