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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/email_valid8.rb +3 -10
  3. metadata +15 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f85d7576339e78f200584de0d50f69a21be5751dcb86f8e52f82c34339e9cd02
4
- data.tar.gz: b905061960b4d839e004544ee804a3fedbc5e5c0ee724a4a68dd75208c987ccc
3
+ metadata.gz: d47e5e536d6c7c9a2d77ab95356c26da915decc951678e3bb2f299fb81dcc10b
4
+ data.tar.gz: 63f1c5ee17fd08512609d8f16b6df58fe8454fd13bbc091f6b0fd959892fbc45
5
5
  SHA512:
6
- metadata.gz: aa80733325f60155cb19fd9879cbce8a4df8d228f5ea0d683352631d9fdf285269a07785d6475702ce8cc784d5fe89c0ce0050be9d1f36af6702a3e49a8250a2
7
- data.tar.gz: bcb5d22a58dfd5ac1376357dcc3c63897c25b8e01adb7c7aeda7e0b63b965b43c4d9ba1efc0005fcc185f1136337ee80c84e5eeb97cd2d5913a4deeb8c92830a
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 validation_check(email)
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
- validation_check(email)
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
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