Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated "Mc" prefix leads to incorrect duplication #2

Open
HLFH opened this issue Sep 29, 2017 · 1 comment
Open

Repeated "Mc" prefix leads to incorrect duplication #2

HLFH opened this issue Sep 29, 2017 · 1 comment

Comments

@HLFH
Copy link
Owner

HLFH commented Sep 29, 2017

@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"
@aprescott
Copy link

I was confused why I was @-mentioned here, but for posterity I see this is a copy of tenderlove#9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants