puppetlabs/puppetlabs-stdlib — pull request #139 by hakamadare (2013-03-29 19:15:18+00:00)
Title: (19864) num2bool match fix

This is another attempt at #137.

This is a bit more heavy-handed than I might like, but it does appear todo the right things:

* accepts numeric input appropriately, truncating floats
* matches string input against a regex, then coerces number-looking strings to int
* makes a best effort to coerce anything else to a string, then subjects it to the same treatment
* raises an error in the event of incorrect number of arguments or non-number-looking strings

I've also included some additional unit tests.