email_valid8 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/email_valid8.rb +3 -10
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d47e5e536d6c7c9a2d77ab95356c26da915decc951678e3bb2f299fb81dcc10b
|
4
|
+
data.tar.gz: 63f1c5ee17fd08512609d8f16b6df58fe8454fd13bbc091f6b0fd959892fbc45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d0fdb21f25ea672e6224fecca501569f536152ed6215daf60a2ddfe4db08a96d91acd24dc313a046a3a5114fe87f08770750c512472d3a7f0d27b692cb703ca
|
7
|
+
data.tar.gz: d7623c30273311f002b653242342ce1d81e4a9955eddc63987f01b54c309f3cd9e69634d54967e463d6c8d4c9a0efc147e6cb179d9c6f1009eca4b3b6786850f
|
data/lib/email_valid8.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active_model'
|
2
|
+
require 'pry'
|
2
3
|
|
3
4
|
class EmailAddressValidator < ActiveModel::Validator
|
4
5
|
def validate(record)
|
@@ -22,20 +23,12 @@ class EmailAddressValidator < ActiveModel::Validator
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def email_checker(email, field, record)
|
25
|
-
return if
|
26
|
+
return if email =~ URI::MailTo::EMAIL_REGEXP && email !~ /[A-Z]/
|
26
27
|
|
27
28
|
record.errors.add(field, 'is not written in a valid format')
|
28
29
|
end
|
29
30
|
|
30
|
-
def validation_check(email)
|
31
|
-
email =~ URI::MailTo::EMAIL_REGEXP && email !~ /[A-Z]/
|
32
|
-
end
|
33
|
-
|
34
31
|
def self.valid?(email)
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.invalid?(email)
|
39
|
-
!validation_check(email)
|
32
|
+
email =~ URI::MailTo::EMAIL_REGEXP && email !~ /[A-Z]/
|
40
33
|
end
|
41
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_valid8
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Boyd
|
@@ -67,6 +67,20 @@ dependencies:
|
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '3.7'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: pry
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.12.2
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.12.2
|
70
84
|
description: This validator uses modern email validation with URI to handle the nuances
|
71
85
|
of checking email throughout your application. Rather than customizing a bunch of
|
72
86
|
random regex that you found on various stack overflow pages, this lets you include
|