skippyPeanutButter / yaml_bot

Validate the content of a yaml file according to a set of rules
MIT License
3 stars 0 forks source link

Support multiple names for a datatype #2

Closed skippyPeanutButter closed 7 years ago

skippyPeanutButter commented 7 years ago

At the moment the accepted_types key takes on a list of datatypes based on existing Ruby datatypes, like those below.

Array
Hash
String
Float
Fixnum
TrueClass
FalseClass

This is not exactly intuitive for those with development experience outside of ruby. Typically in most languages you'll see true and false values denoted as a Boolean datatype rather than TrueClass, or FalseClass. Same thing with integers, which Ruby denotes as a Fixnum.

It would be nice to support multiple names for the same datatype, such as having Fixnum, Integer, Int as accepted_types values for a particular key that expects an integer number.

skippyPeanutButter commented 7 years ago

This was done as part of PR https://github.com/skippyPeanutButter/yaml_bot/pull/25 Code sample here