-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Revise ruby valid logic to one line #79
Conversation
361840d
to
63aa265
Compare
return false unless valid_email?(email) | ||
|
||
!blacklisted?(email) | ||
return valid_email?(email) && !blacklisted?(email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid_email?(email) && !blacklisted?(email)
return false if email.nil? | ||
|
||
email =~ EMAIL_REGEX | ||
return !email.nil? && !!(email =~ EMAIL_REGEX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!email.nil? && !!(email =~ EMAIL_REGEX)
return false unless valid_email?(email) | ||
|
||
!blacklisted?(email) | ||
return valid_email?(email) && !blacklisted?(email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid_email?(email) && !blacklisted?(email)
return false if email.nil? | ||
|
||
email =~ EMAIL_REGEX | ||
return !email.nil? && !!(email =~ EMAIL_REGEX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!email.nil? && !!(email =~ EMAIL_REGEX)
Hello @dav1a1223, as @JulienBreux said, just remove the return and I will accept this PR :) |
63aa265
to
ef62e81
Compare
OK, it's done. @FGRibreau @JulienBreux thanks a lot !! |
@dav1a1223 nice work, released in v3.0.16 :) |
Dear @FGRibreau ,
When I use this handy gem and read the source code,
I found the logic of
valid?
andvalid_email?
a little complex.So I took a look at
.py
and revise the logic to one line.Hoping that make it easier to understand :)
I'm a beginner to contribute open source, please give me your advice. :)
Thx a lot!!