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

Feature/regexp #45

Merged
merged 6 commits into from
Sep 29, 2014
Merged

Feature/regexp #45

merged 6 commits into from
Sep 29, 2014

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Sep 24, 2014

This allows the user to define the regular expression to be used to sanitize the slug.
It can be set either in the constructor or by calling the method setRegExp.
By default the regular expression is the same that was being used until now.

@florianeckerstorfer
Copy link
Member

Why is the constant named LOWERCASE_NUMBERS_UNDERSCORES? Also, in which way does the name relate to the expression?

@acelaya
Copy link
Contributor Author

acelaya commented Sep 24, 2014

Whoops, I meant to name it LOWERCASE_NUMBERS_DASHES (not UNDERSCORES) because it only matches lowercases, numbers and dashes, any other character is replaced by the separator character, am I right?
Anyway, before changing it, how do you suggest to name it? I'm not very creative with this kind of names.

@florianeckerstorfer
Copy link
Member

Ok, I get it. You meant LOWERCASE for characters, but it looks like it means lowercase numbers.

Currently I don't have a better suggestion, because optimally it would be precise and short. Anyway, the regular expression means match every character that is not a lowercase letter and not a number or that is a dash.

@acelaya
Copy link
Contributor Author

acelaya commented Sep 24, 2014

Yes, its not very descriptive but I meant lowercase, numbers, dashes, not lowercase numbers, but I understand the confusion.
However, the name I chose (regardless typos) isn't completly correct, what do you think if I just change it to DEFAULT_REGEXP

@acelaya
Copy link
Contributor Author

acelaya commented Sep 26, 2014

Finally named it LOWERCASE_NUMBERS_NOT_DASHES (like in lowercase letters, numbers and not dashes).
It's a little bit long, but I couldn't find a better name.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.92%) when pulling b707292 on acelaya:feature/regexp into 9da3415 on cocur:master.

@acelaya
Copy link
Contributor Author

acelaya commented Sep 26, 2014

Hmmm, it looks that the code coverage decreased. Let me fix it.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 29e783f on acelaya:feature/regexp into 9da3415 on cocur:master.

@florianeckerstorfer
Copy link
Member

Could you name the constant LOWERCASE_NUMBERS_DASHES. Because this regular expression generates a slug that contains lowercase letters, numbers and dashes.

@acelaya
Copy link
Contributor Author

acelaya commented Sep 28, 2014

Done

florianeckerstorfer pushed a commit that referenced this pull request Sep 29, 2014
@florianeckerstorfer florianeckerstorfer merged commit d4fa40f into cocur:master Sep 29, 2014
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

Successfully merging this pull request may close these issues.

None yet

3 participants