validates_email_format_of 1.5.1 → 1.5.2
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/lib/validates_email_format_of.rb +2 -2
- data/rakefile.rb +1 -1
- data/test/validates_email_format_of_test.rb +6 -4
- metadata +68 -22
@@ -2,7 +2,7 @@
|
|
2
2
|
module ValidatesEmailFormatOf
|
3
3
|
require 'resolv'
|
4
4
|
|
5
|
-
VERSION = '1.5.
|
5
|
+
VERSION = '1.5.2'
|
6
6
|
|
7
7
|
MessageScope = defined?(ActiveModel) ? :activemodel : :activerecord
|
8
8
|
|
@@ -44,7 +44,7 @@ module ValidatesEmailFormatOf
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# need local and domain parts
|
47
|
-
return [ opts[:message] ] unless local and domain
|
47
|
+
return [ opts[:message] ] unless local and not local.empty? and domain and not domain.empty?
|
48
48
|
|
49
49
|
# check lengths
|
50
50
|
return [ opts[:message] ] unless domain.length <= opts[:domain_length] and local.length <= opts[:local_length]
|
data/rakefile.rb
CHANGED
@@ -92,7 +92,10 @@ class ValidatesEmailFormatOfTest < TEST_CASE
|
|
92
92
|
"foo@example.com\nexample@gmail.com",
|
93
93
|
'invalid@example.',
|
94
94
|
"\"foo\\\\\"\"@bar.com",
|
95
|
-
"foo@mail.com\r\nfoo@mail.com"
|
95
|
+
"foo@mail.com\r\nfoo@mail.com",
|
96
|
+
'@example.com',
|
97
|
+
'foo@',
|
98
|
+
'foo'
|
96
99
|
].each do |email|
|
97
100
|
assert_invalid(email)
|
98
101
|
end
|
@@ -208,12 +211,11 @@ class ValidatesEmailFormatOfTest < TEST_CASE
|
|
208
211
|
end
|
209
212
|
|
210
213
|
def assert_valid(email)
|
211
|
-
assert_nil ValidatesEmailFormatOf::validate_email_format(email)
|
214
|
+
assert_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should be considered valid"
|
212
215
|
end
|
213
216
|
|
214
217
|
def assert_invalid(email)
|
215
|
-
|
216
|
-
assert_equal 1, err.size
|
218
|
+
assert_not_nil ValidatesEmailFormatOf::validate_email_format(email), "#{email} should not be considered valid"
|
217
219
|
end
|
218
220
|
|
219
221
|
def save_passes(p, email = '')
|
metadata
CHANGED
@@ -1,24 +1,61 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_email_format_of
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 5
|
9
|
+
- 2
|
10
|
+
version: 1.5.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Alex Dunae
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2011-09-16 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: sqlite3
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: activerecord
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
14
49
|
description: Validate e-mail addresses against RFC 2822 and RFC 3696.
|
15
50
|
email: code@dunae.ca
|
16
51
|
executables: []
|
52
|
+
|
17
53
|
extensions: []
|
18
|
-
|
54
|
+
|
55
|
+
extra_rdoc_files:
|
19
56
|
- README.rdoc
|
20
57
|
- MIT-LICENSE
|
21
|
-
files:
|
58
|
+
files:
|
22
59
|
- MIT-LICENSE
|
23
60
|
- init.rb
|
24
61
|
- rakefile.rb
|
@@ -30,33 +67,42 @@ files:
|
|
30
67
|
- test/validates_email_format_of_test.rb
|
31
68
|
- test/database.yml
|
32
69
|
- test/fixtures/people.yml
|
70
|
+
has_rdoc: true
|
33
71
|
homepage: https://github.com/alexdunae/validates_email_format_of
|
34
72
|
licenses: []
|
73
|
+
|
35
74
|
post_install_message:
|
36
|
-
rdoc_options:
|
75
|
+
rdoc_options:
|
37
76
|
- --title
|
38
77
|
- validates_email_format_of
|
39
|
-
require_paths:
|
78
|
+
require_paths:
|
40
79
|
- lib
|
41
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
81
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
90
|
none: false
|
49
|
-
requirements:
|
50
|
-
- -
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 3
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
53
98
|
requirements: []
|
99
|
+
|
54
100
|
rubyforge_project:
|
55
|
-
rubygems_version: 1.
|
101
|
+
rubygems_version: 1.5.2
|
56
102
|
signing_key:
|
57
103
|
specification_version: 3
|
58
104
|
summary: Validate e-mail addresses against RFC 2822 and RFC 3696.
|
59
|
-
test_files:
|
105
|
+
test_files:
|
60
106
|
- test/fixtures/person.rb
|
61
107
|
- test/schema.rb
|
62
108
|
- test/test_helper.rb
|