lib/rails/real/email.rb in rails-real-email-0.1.0 vs lib/rails/real/email.rb in rails-real-email-0.1.1
- old
+ new
@@ -2,11 +2,22 @@
require "rails/real/email/mail_check.rb"
module Rails
module Real
module Email
+
+ VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
+
def self.email_is_real?(email)
+ return false unless email.match VALID_EMAIL_REGEX
MailCheck.run(email).invalid?
end
+
+ def self.excute(email)
+ return false unless email.match VALID_EMAIL_REGEX
+ MailCheck.run(email).invalid?
+ end
end
end
end
+
+EmailVerify = Rails::Real::Email