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

New: auto-camelify their input name. #112

Merged
merged 2 commits into from Sep 4, 2014

Conversation

Projects
None yet
2 participants
@mwmiller
Contributor

mwmiller commented Sep 3, 2014

This will take all of their words and turn it into TheRightThing for our
purposes.

Addresses #110.

NB: I have no idea how to properly add tests for this, but I can show you here that it worked:

[matt@mwm-tpad zeroclickinfo-goodies] (master)$ duckpan new the walkIng DEAD

Created file: ./t/TheWalkingDead.t


Created file: ./lib/DDG/Goodie/TheWalkingDead.pm


Successfully created Goodie: TheWalkingDead
New: auto-camelify their input name.
This will take all of their words and turn it into TheRightThing for our
purposes.

Addresses #110.

@moollaza moollaza added the Improvement label Sep 4, 2014

@moollaza

This comment has been minimized.

Show comment
Hide comment
@moollaza

moollaza Sep 4, 2014

Member

@mwmiller this is great -- my only concern is the conversion of successive capitals to lowercase (DEAD -> Dead) -- that might not always be what the dev wants (e.g. LeakDB, BBC, OpenSNP) so perhaps we should only force the removal of Spaces and make sure first letters are capitalized

Member

moollaza commented Sep 4, 2014

@mwmiller this is great -- my only concern is the conversion of successive capitals to lowercase (DEAD -> Dead) -- that might not always be what the dev wants (e.g. LeakDB, BBC, OpenSNP) so perhaps we should only force the removal of Spaces and make sure first letters are capitalized

@mwmiller

This comment has been minimized.

Show comment
Hide comment
@mwmiller

mwmiller Sep 4, 2014

Contributor

@moollaza That's fair. Would you like it to explicitly check for ALL CAPS words and leave them alone or just do the ucfirst?

I don't know how many other people fat-finger capitals into the middle of their words like I do. 😁

Contributor

mwmiller commented Sep 4, 2014

@moollaza That's fair. Would you like it to explicitly check for ALL CAPS words and leave them alone or just do the ucfirst?

I don't know how many other people fat-finger capitals into the middle of their words like I do. 😁

@moollaza

This comment has been minimized.

Show comment
Hide comment
@moollaza

moollaza Sep 4, 2014

Member

@mwmiller I think that ucfirst on each word should suffice

Member

moollaza commented Sep 4, 2014

@mwmiller I think that ucfirst on each word should suffice

phrase_to_camel_case: let it have more humps.
We'll only force the first letters to caps and assume they know what
they are doing with the rest of it.
@mwmiller

This comment has been minimized.

Show comment
Hide comment
@mwmiller

mwmiller Sep 4, 2014

Contributor

@moollaza Ok, this is done. I'm not sure how camel-y is actually makes the names, but it does resolve your spaces issue, so it's got that going for it.

Contributor

mwmiller commented Sep 4, 2014

@moollaza Ok, this is done. I'm not sure how camel-y is actually makes the names, but it does resolve your spaces issue, so it's got that going for it.

@moollaza

This comment has been minimized.

Show comment
Hide comment
@moollaza

moollaza Sep 4, 2014

Member

haha, well LGTM 👍

Member

moollaza commented Sep 4, 2014

haha, well LGTM 👍

moollaza added a commit that referenced this pull request Sep 4, 2014

Merge pull request #112 from mwmiller/dromedary
New: auto-camelify their input name.

@moollaza moollaza merged commit ba278e6 into duckduckgo:master Sep 4, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details

@mwmiller mwmiller deleted the mwmiller:dromedary branch Sep 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment