validates_email_format_of 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +4 -0
- data/lib/validates_email_format_of.rb +3 -3
- data/test/validates_email_format_of_test.rb +3 -1
- metadata +6 -3
data/CHANGELOG.rdoc
CHANGED
@@ -3,9 +3,9 @@ module ValidatesEmailFormatOf
|
|
3
3
|
require 'resolv'
|
4
4
|
|
5
5
|
LocalPartSpecialChars = Regexp.escape('!#$%&\'*-/=?+-^_`{|}~')
|
6
|
-
LocalPartUnquoted = '(
|
7
|
-
LocalPartQuoted = '\"(
|
8
|
-
Regex = Regexp.new('\A(
|
6
|
+
LocalPartUnquoted = '([[:alnum:]' + LocalPartSpecialChars + ']+[\.\+]+)*[[:alnum:]' + LocalPartSpecialChars + '+]+'
|
7
|
+
LocalPartQuoted = '\"([[:alnum:]' + LocalPartSpecialChars + '\.\+]|\\\\[\x00-\xFF])*\"'
|
8
|
+
Regex = Regexp.new('\A(' + LocalPartUnquoted + '|' + LocalPartQuoted + '+)@(((\w+\-+[^_])|(\w+\.[a-z0-9-]*))*([a-z0-9-]{1,63})\.[a-z]{2,6}(?:\.[a-z]{2,6})?\Z)', Regexp::EXTENDED | Regexp::IGNORECASE, 'n')
|
9
9
|
|
10
10
|
def self.validate_email_domain(email)
|
11
11
|
domain = email.match(/\@(.+)/)[1]
|
@@ -65,6 +65,8 @@ class ValidatesEmailFormatOfTest < TEST_CASE
|
|
65
65
|
'invalid@example.b#r.com',
|
66
66
|
'invalid@example.c',
|
67
67
|
'invali d@example.com',
|
68
|
+
# unclosed quote
|
69
|
+
"\"a-17180061943-10618354-1993365053",
|
68
70
|
'invalidexample.com',
|
69
71
|
# should not allow special chars after a period in the domain
|
70
72
|
'local@sub.)domain.com',
|
@@ -87,7 +89,7 @@ class ValidatesEmailFormatOfTest < TEST_CASE
|
|
87
89
|
save_passes(p, email)
|
88
90
|
end
|
89
91
|
end
|
90
|
-
|
92
|
+
|
91
93
|
# from http://tools.ietf.org/html/rfc3696, page 5
|
92
94
|
# corrected in http://www.rfc-editor.org/errata_search.php?rfc=3696
|
93
95
|
def test_should_not_allow_escaped_characters_without_quotes
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_email_format_of
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 4
|
8
|
-
-
|
9
|
-
version: 1.4.
|
9
|
+
- 3
|
10
|
+
version: 1.4.3
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Alex Dunae
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-12-12 00:00:00 -08:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -56,6 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
57
|
requirements:
|
57
58
|
- - ">="
|
58
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
59
61
|
segments:
|
60
62
|
- 0
|
61
63
|
version: "0"
|
@@ -64,6 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
66
|
requirements:
|
65
67
|
- - ">="
|
66
68
|
- !ruby/object:Gem::Version
|
69
|
+
hash: 3
|
67
70
|
segments:
|
68
71
|
- 0
|
69
72
|
version: "0"
|