spectator-validates_email 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/validates_email/email_validator.rb +3 -6
- data/lib/validates_email/version.rb +1 -1
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9d6f064b39f786b9f44abf0c7397f10020a10110a61a33cd3a74565e14dde2f9
|
4
|
+
data.tar.gz: 0b38b38837bb3c6a61b2ebf53f5e55a48c0790dfaa7becb8312003a3e416c5d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a1ba060243e5b00c8aea3320fb42afefa967fe343b4cdc00b1bbed28da632b3a793d2981b978f6a53bd482a4dddf990932dfa2c49d5cdb164817a8f944b028
|
7
|
+
data.tar.gz: 195838246706f0d5c2a3f7b3240261c8a70879ceff9c15e0c61392c4487ac1f1391c14b1ac57f31fcf63aab0f40c493bbb83f234eeac396d4a6e9f8a2655b0a6
|
@@ -1,10 +1,7 @@
|
|
1
|
-
# Email validation class which uses Rails
|
1
|
+
# Email validation class which uses Rails 4 ActiveModel
|
2
2
|
# validation mechanism.
|
3
3
|
#
|
4
4
|
class EmailValidator < ActiveModel::EachValidator
|
5
|
-
class Encoding
|
6
|
-
class CompatibilityError < StandardError; end
|
7
|
-
end if RUBY_VERSION.to_f < 1.9
|
8
5
|
|
9
6
|
LocalPartSpecialChars = Regexp.escape('!#$%&\'*-/=?+-^_`{|}~')
|
10
7
|
LocalPartUnquoted = '(([[:alnum:]' + LocalPartSpecialChars + ']+[\.\+]+))*[[:alnum:]' + LocalPartSpecialChars + '+]+'
|
@@ -23,10 +20,10 @@ class EmailValidator < ActiveModel::EachValidator
|
|
23
20
|
def validate_each(record, attribute, value)
|
24
21
|
if validates_email_format(value)
|
25
22
|
if options[:mx] && !validates_email_domain(value, options[:mx])
|
26
|
-
record.errors
|
23
|
+
record.errors.add(attribute, (options[:mx_message] || I18n.t(:mx_invalid, scope: [:activerecord, :errors, :messages])))
|
27
24
|
end
|
28
25
|
else
|
29
|
-
record.errors
|
26
|
+
record.errors.add(attribute, (options[:message] || I18n.t(:invalid, scope: [:activerecord, :errors, :messages])))
|
30
27
|
end
|
31
28
|
end
|
32
29
|
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spectator-validates_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Velikanau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.2.0
|
27
27
|
description: Rails plugin to validate email addresses against RFC 2822 and RFC 3696
|
28
28
|
email:
|
29
29
|
- yury.velikanau@gmail.com
|
@@ -31,10 +31,10 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- MIT-LICENSE
|
35
|
+
- lib/validates_email.rb
|
34
36
|
- lib/validates_email/email_validator.rb
|
35
37
|
- lib/validates_email/version.rb
|
36
|
-
- lib/validates_email.rb
|
37
|
-
- MIT-LICENSE
|
38
38
|
homepage: http://github.com/spectator/validates_email
|
39
39
|
licenses: []
|
40
40
|
metadata: {}
|
@@ -44,19 +44,18 @@ require_paths:
|
|
44
44
|
- lib
|
45
45
|
required_ruby_version: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.3.6
|
55
55
|
requirements: []
|
56
56
|
rubyforge_project:
|
57
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.7.6.2
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Rails plugin to validate email addresses
|
61
61
|
test_files: []
|
62
|
-
has_rdoc:
|