Open HLFH opened 7 years ago
@aprescott
I'm not sure if this is actually a bug, given possible real-world inputs, but it certainly seems wrong. > NameCase("mcfoo mcbar") => "McFoo McFoo" > NameCase("MCFOO MCBAR") => "McFoo McFoo" The "McBar" has been clobbered by "McFoo" because the replacement is global across the whole string. This gem seems to support passing a full first+last name input, so this looks like a bug to me. Note this working case, though: > NameCase("McFoo McBar") => "McFoo McBar"
I'm not sure if this is actually a bug, given possible real-world inputs, but it certainly seems wrong.
> NameCase("mcfoo mcbar") => "McFoo McFoo" > NameCase("MCFOO MCBAR") => "McFoo McFoo"
The "McBar" has been clobbered by "McFoo" because the replacement is global across the whole string. This gem seems to support passing a full first+last name input, so this looks like a bug to me. Note this working case, though:
> NameCase("McFoo McBar") => "McFoo McBar"
I was confused why I was @-mentioned here, but for posterity I see this is a copy of https://github.com/tenderlove/namecase/issues/9.
@aprescott