balderdashy/anchor — pull request #30 by s2gatev (2013-12-29 13:08:48+00:00)
Title: Split rules and add messages.

In my opinion the validation rules should be more flexible than single functions. They should support custom error messages (#29) and perhaps other goodies that would come later. That's why I suggest splitting them into separate files / objects that would be easier to maintain and present more opportunities for extension.

Currently I have implemented them in a folder /rules and every rule inside is loaded automatically.
I have implemented some example error messages that in my opinion are more human-readable than the current.

If you like the idea of this refactoring we could continue polishing the code : ))

Note: I am also thinking of adding more tests for the rules.