dtao/safe_yaml — pull request #51 by gjtorikian (2013-12-16 16:52:29+00:00)
Title: [bugfix] Substitute _ for decimal values

This fixes a bug with the `ToInteger#transform?` implementation.

Suppose you have a key:value pair of `wordpress_id: 850_`. `Integer(value.gsub(",", ""))` causes an `ArgumentError`, because the `_` is not stripped away.

Right now we're checking if the first matcher--the decimal value--has an `_` and getting rid of it. We can't just parse the `_` away, because binary values (`/\A0b[01_]+\Z`) still need it.