ruby_email 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG +3 -0
- data/README.md +5 -2
- data/lib/ruby_email/rfc1123/public/string.rb +5 -0
- data/lib/ruby_email/rfc1123/public.rb +22 -0
- data/lib/ruby_email/rfc1123/string.rb +5 -0
- data/lib/ruby_email/rfc1123.rb +39 -0
- data/lib/ruby_email/rfc5322/public.rb +2 -1
- data/lib/ruby_email/rfc5322.rb +15 -7
- data/lib/ruby_email.rb +2 -0
- data/ruby_email.gemspec +6 -0
- data/test/rfc1123.rb +84 -0
- data/test/rfc5322.rb +79 -0
- data/test/unit_test.rb +2 -73
- data/version +1 -1
- data.tar.gz.sig +0 -0
- metadata +7 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0af7e294ab593344d60503c202e28101564e99
|
4
|
+
data.tar.gz: 68d07606c01697cac35810a6678b744f59a8e469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e759d12958e3fd79ceddde57f4a3fffd742593f0f590c6dca1c6a7723e8dcecde4ed279faf349a2ce52852bd2c21a9153e0cc280d18920bade8ef66cbc5dac1
|
7
|
+
data.tar.gz: a6313085eaa139c284bbd7e63fba0879053d6e0c8bdbdc4619e0ab417b0ba3694113a18065e1e548ff7c14e5517bc1054254b9ec4eab4f17d0d268d1fd1bc8ed
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# A RFC compliant Email validator
|
2
2
|
|
3
|
-
What is an [
|
3
|
+
- What is an [Email Address](https://en.wikipedia.org/wiki/Email_address) ?
|
4
|
+
- What is a [Domain Name](https://en.wikipedia.org/wiki/Hostname) ?
|
5
|
+
|
6
|
+
- Compliant to the [Rfc 5322](https://tools.ietf.org/html/rfc5322).
|
7
|
+
- Compliant to the [Rfc 1123](https://tools.ietf.org/html/rfc1123).
|
4
8
|
|
5
|
-
- Compliant to the [rfc 5322](https://tools.ietf.org/html/rfc5322) standard.
|
6
9
|
- To do [rfc 6530](https://tools.ietf.org/html/rfc6530).
|
7
10
|
|
8
11
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative '../rfc1123'
|
2
|
+
|
3
|
+
module RubyEmail
|
4
|
+
class Rfc1123
|
5
|
+
|
6
|
+
# Internet realist version of {Rfc5322}. It requires 2 names (a.b).
|
7
|
+
class Public < Rfc1123
|
8
|
+
DOT_ATOM_TEXT = "(?=.{1,253})((#{ATOM_ALL}\\.)+#{ATOM_FIRST})"
|
9
|
+
VALIDE = "(?<domain>#{DOT_ATOM_TEXT})"
|
10
|
+
REGEXP = Regexp.new "\\A#{VALIDE}\\Z"
|
11
|
+
|
12
|
+
module String
|
13
|
+
# Check if the current [::String] instance is a valid domain on internet
|
14
|
+
# @return [TrueClass or FalseClass]
|
15
|
+
def is_public_domain?
|
16
|
+
RubyEmail::Rfc1123::Public.validates? self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative 'core'
|
2
|
+
|
3
|
+
module RubyEmail
|
4
|
+
|
5
|
+
# a Domain Name follows the Rfc1123: https://tools.ietf.org/html/rfc1123
|
6
|
+
class Rfc1123 < Core
|
7
|
+
# one valid character for domain part (first name first character)
|
8
|
+
ATEXT_FIRST_FIRST = '([A-Za-z])'
|
9
|
+
# one valid character for domain part (first name all other characters)
|
10
|
+
ATEXT_FIRST_ALL = '([A-Za-z0-9])'
|
11
|
+
# one valid character for domain part (all other names)
|
12
|
+
ATEXT_ALL = '([A-Za-z0-9\-])'
|
13
|
+
|
14
|
+
# a valid string for domain part (first name)
|
15
|
+
ATOM_FIRST = "#{ATEXT_FIRST_FIRST}#{ATEXT_ALL}{,62}"
|
16
|
+
# a valid string for domain part (all other names)
|
17
|
+
ATOM_ALL = "#{ATEXT_FIRST_ALL}#{ATEXT_ALL}{,62}"
|
18
|
+
|
19
|
+
# a valid string with subdomains, separated by dots for domain part as IPV4
|
20
|
+
IPV4 = '(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
|
21
|
+
# a valid string with subdomains, separated by dots for domain part as Domain Name
|
22
|
+
DOT_ATOM_TEXT = "(?=.{1,253})((#{ATOM_ALL}\\.)*#{ATOM_FIRST})"
|
23
|
+
|
24
|
+
# email grammar
|
25
|
+
VALIDE = "(?<domain>((#{DOT_ATOM_TEXT})|(#{IPV4})))"
|
26
|
+
|
27
|
+
# regexp to validate complete email
|
28
|
+
REGEXP = Regexp.new "\\A#{VALIDE}\\Z"
|
29
|
+
|
30
|
+
module String
|
31
|
+
# Check if the current [::String] instance is a valid domain
|
32
|
+
# @return [TrueClass or FalseClass]
|
33
|
+
def is_domain?
|
34
|
+
RubyEmail::Rfc1123.validates? self
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require_relative '../rfc5322'
|
2
|
+
require_relative '../rfc1123/public'
|
2
3
|
|
3
4
|
module RubyEmail
|
4
5
|
class Rfc5322
|
5
6
|
|
6
7
|
# Internet realist version of {Rfc5322}. It requires a root domain.
|
7
8
|
class Public < Rfc5322
|
8
|
-
VALIDE = "(?<local>#{DOT_ATOM_TEXT})@(
|
9
|
+
VALIDE = "(?<local>#{DOT_ATOM_TEXT})@(#{Rfc1123::Public::VALIDE})"
|
9
10
|
REGEXP = Regexp.new "\\A#{VALIDE}\\Z"
|
10
11
|
|
11
12
|
module String
|
data/lib/ruby_email/rfc5322.rb
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
require_relative 'core'
|
2
|
+
require_relative 'rfc1123'
|
2
3
|
|
3
4
|
module RubyEmail
|
4
5
|
|
5
|
-
# http://www.ietf.org/rfc/rfc5322.txt
|
6
|
-
#
|
7
|
-
#
|
6
|
+
# an Email Address follows the Rfc5322: http://www.ietf.org/rfc/rfc5322.txt
|
7
|
+
# a Domain Name follows the Rfc1123: https://tools.ietf.org/html/rfc1123
|
8
|
+
# The Rfc5322 designate an email with the format local@domain, where
|
9
|
+
# - local is a string of US-ASCII characters, without some symboles.
|
10
|
+
# - domain is a valid Domain Name
|
8
11
|
class Rfc5322 < Core
|
9
|
-
# one valid character (not
|
12
|
+
# one valid character for local part (do not take escaped because the Rfc prefere to avoid them)
|
10
13
|
ATEXT = '([A-Za-z0-9!#\$%&\'*\+\-/=\?\^_`\{\}\|~])'
|
11
|
-
|
14
|
+
|
15
|
+
# a valid string for local part
|
12
16
|
ATOM = "#{ATEXT}+"
|
13
|
-
|
17
|
+
|
18
|
+
# a valid string with subdomains, separated by dots for local part
|
14
19
|
DOT_ATOM_TEXT = "(#{ATOM})(\\.#{ATOM})*"
|
20
|
+
|
15
21
|
# email grammar
|
16
|
-
VALIDE = "(?<local>#{DOT_ATOM_TEXT})@(
|
22
|
+
VALIDE = "(?<local>#{DOT_ATOM_TEXT})@(#{Rfc1123::VALIDE})"
|
23
|
+
|
17
24
|
# regexp to validate complete email
|
18
25
|
REGEXP = Regexp.new "\\A#{VALIDE}\\Z"
|
26
|
+
|
19
27
|
module String
|
20
28
|
# Check if the current [::String] instance is a valid email
|
21
29
|
# @return [TrueClass or FalseClass]
|
data/lib/ruby_email.rb
CHANGED
data/ruby_email.gemspec
CHANGED
@@ -13,6 +13,10 @@ lib/ruby_email/rfc5322.rb
|
|
13
13
|
lib/ruby_email/rfc5322/string.rb
|
14
14
|
lib/ruby_email/rfc5322/public.rb
|
15
15
|
lib/ruby_email/rfc5322/public/string.rb
|
16
|
+
lib/ruby_email/rfc1123.rb
|
17
|
+
lib/ruby_email/rfc1123/string.rb
|
18
|
+
lib/ruby_email/rfc1123/public.rb
|
19
|
+
lib/ruby_email/rfc1123/public/string.rb
|
16
20
|
|
17
21
|
README.md
|
18
22
|
CHANGELOG
|
@@ -24,6 +28,8 @@ ruby_email.gemspec
|
|
24
28
|
version
|
25
29
|
|
26
30
|
test/unit_test.rb
|
31
|
+
test/rfc1123.rb
|
32
|
+
test/rfc5322.rb
|
27
33
|
)
|
28
34
|
s.executables = %w(
|
29
35
|
)
|
data/test/rfc1123.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
class TestRubyEmailRfc1123 < Test::Unit::TestCase
|
2
|
+
|
3
|
+
def test_simple_true
|
4
|
+
assert RubyEmail::Rfc1123.validates?("toto")
|
5
|
+
assert RubyEmail::Rfc1123.validates?("toto.toto")
|
6
|
+
assert RubyEmail::Rfc1123.validates?("toto.toto.toto")
|
7
|
+
assert RubyEmail::Rfc1123.validates?("toto.toto.toto.toto")
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_simple_false
|
11
|
+
assert !RubyEmail::Rfc1123.validates?("-1")
|
12
|
+
assert !RubyEmail::Rfc1123.validates?("t@")
|
13
|
+
assert !RubyEmail::Rfc1123.validates?("@t")
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_plus_true
|
17
|
+
assert RubyEmail::Rfc1123.validates?("mail.com")
|
18
|
+
assert RubyEmail::Rfc1123.validates?("0mail.com")
|
19
|
+
assert RubyEmail::Rfc1123.validates?("t1oto")
|
20
|
+
assert RubyEmail::Rfc1123.validates?("t1oto")
|
21
|
+
assert RubyEmail::Rfc1123.validates?("1.toto")
|
22
|
+
assert RubyEmail::Rfc1123.validates?("127.0.0.1")
|
23
|
+
assert RubyEmail::Rfc1123.validates?("255.254.251.0")
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_plus_false
|
27
|
+
assert !RubyEmail::Rfc1123.validates?("some things")
|
28
|
+
assert !RubyEmail::Rfc1123.validates?("toto;toto")
|
29
|
+
assert !RubyEmail::Rfc1123.validates?("some things")
|
30
|
+
assert !RubyEmail::Rfc1123.validates?("toto,toto")
|
31
|
+
assert !RubyEmail::Rfc1123.validates?("toto()toto")
|
32
|
+
assert !RubyEmail::Rfc1123.validates?("toto[]toto")
|
33
|
+
assert !RubyEmail::Rfc1123.validates?("toto:toto")
|
34
|
+
assert !RubyEmail::Rfc1123.validates?("toto<>toto")
|
35
|
+
assert !RubyEmail::Rfc1123.validates?("toto\\toto")
|
36
|
+
assert !RubyEmail::Rfc1123.validates?("toto\"toto")
|
37
|
+
assert !RubyEmail::Rfc1123.validates?("-root")
|
38
|
+
assert !RubyEmail::Rfc1123.validates?("0.0.0.-1")
|
39
|
+
assert !RubyEmail::Rfc1123.validates?("256.255.254.1")
|
40
|
+
assert !RubyEmail::Rfc1123.validates?("1")
|
41
|
+
assert !RubyEmail::Rfc1123.validates?("111")
|
42
|
+
assert !RubyEmail::Rfc1123.validates?("a.1")
|
43
|
+
assert !RubyEmail::Rfc1123.validates?("1.1")
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_match
|
47
|
+
m = RubyEmail::Rfc1123.match "toto.toto.toto.toto"
|
48
|
+
assert m.names & %w(domain)
|
49
|
+
assert_equal "toto.toto.toto.toto", m["domain"]
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_string
|
53
|
+
assert_raise { "toto@toto".is_domain? }
|
54
|
+
require_relative '../lib/ruby_email/rfc1123/string'
|
55
|
+
assert "toto".is_domain?
|
56
|
+
assert !"___".is_domain?
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_exceptions
|
60
|
+
assert_raise { RubyEmail::Rfc1123.match 1 }
|
61
|
+
assert_raise { RubyEmail::Rfc1123.validates? 1.0 }
|
62
|
+
assert_raise { RubyEmail::Rfc1123.validates? /toto/ }
|
63
|
+
assert_raise { RubyEmail::Rfc1123.validates? :ok }
|
64
|
+
assert_raise { RubyEmail::Rfc1123.validates? Class }
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
class TestRubyEmailRfc1123Public < Test::Unit::TestCase
|
70
|
+
def test_simpe
|
71
|
+
assert RubyEmail::Rfc1123::Public.validates?("toto.toto")
|
72
|
+
assert RubyEmail::Rfc1123::Public.validates?("toto.toto.toto")
|
73
|
+
assert RubyEmail::Rfc1123::Public.validates?("toto.toto.toto.toto")
|
74
|
+
assert !RubyEmail::Rfc1123::Public.validates?("toto")
|
75
|
+
assert RubyEmail::Rfc1123::Public.match("toto.toto")
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_string
|
79
|
+
assert_raise { "toto.toto".is_public_domain? }
|
80
|
+
require_relative '../lib/ruby_email/rfc1123/public/string'
|
81
|
+
assert "toto.toto".is_public_domain?
|
82
|
+
assert !"toto".is_public_domain?
|
83
|
+
end
|
84
|
+
end
|
data/test/rfc5322.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
class TestRubyEmailRfc5322 < Test::Unit::TestCase
|
2
|
+
|
3
|
+
def test_simple_true
|
4
|
+
assert RubyEmail::Rfc5322.validates?("toto@toto")
|
5
|
+
assert RubyEmail::Rfc5322.validates?("toto@toto.toto")
|
6
|
+
assert RubyEmail::Rfc5322.validates?("toto@toto.toto.toto")
|
7
|
+
assert RubyEmail::Rfc5322.validates?("toto@toto.toto.toto.toto")
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_simple_false
|
11
|
+
assert !RubyEmail::Rfc5322.validates?("t")
|
12
|
+
assert !RubyEmail::Rfc5322.validates?("t@")
|
13
|
+
assert !RubyEmail::Rfc5322.validates?("@t")
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_plus_true
|
17
|
+
assert RubyEmail::Rfc5322.validates?("i'am%toto@here")
|
18
|
+
assert RubyEmail::Rfc5322.validates?("ich-bin-toto@ta-ta")
|
19
|
+
assert RubyEmail::Rfc5322.validates?("arthur+spam@mail.com")
|
20
|
+
assert RubyEmail::Rfc5322.validates?("arthur+spam@0mail.com")
|
21
|
+
assert RubyEmail::Rfc5322.validates?("arthur+spam@127.0.0.1")
|
22
|
+
assert RubyEmail::Rfc5322.validates?("arthur+spam@255.254.251.0")
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_plus_false
|
26
|
+
assert !RubyEmail::Rfc5322.validates?("i have @ some things")
|
27
|
+
assert !RubyEmail::Rfc5322.validates?("toto;toto@toto;toto")
|
28
|
+
assert !RubyEmail::Rfc5322.validates?("toto,toto@toto,toto")
|
29
|
+
assert !RubyEmail::Rfc5322.validates?("toto()toto@toto()toto")
|
30
|
+
assert !RubyEmail::Rfc5322.validates?("toto[]toto@toto[]toto")
|
31
|
+
assert !RubyEmail::Rfc5322.validates?("toto:toto@toto:toto")
|
32
|
+
assert !RubyEmail::Rfc5322.validates?("toto<>toto@toto<>toto")
|
33
|
+
assert !RubyEmail::Rfc5322.validates?("toto\\toto@toto\\toto")
|
34
|
+
assert !RubyEmail::Rfc5322.validates?("toto\"toto@toto\"toto")
|
35
|
+
assert !RubyEmail::Rfc5322.validates?("arthur+spam@-root")
|
36
|
+
assert !RubyEmail::Rfc5322.validates?("arthur+spam@0.0.0.-1")
|
37
|
+
assert !RubyEmail::Rfc5322.validates?("arthur+spam@256.255.254.1")
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_match
|
41
|
+
m = RubyEmail::Rfc5322.match "toto@toto.toto.toto.toto"
|
42
|
+
assert m.names & %w(local domain)
|
43
|
+
assert_equal "toto", m["local"]
|
44
|
+
assert_equal "toto.toto.toto.toto", m["domain"]
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_string
|
48
|
+
assert_raise { "toto@toto".is_email? }
|
49
|
+
require_relative '../lib/ruby_email/rfc5322/string'
|
50
|
+
assert "toto@toto".is_email?
|
51
|
+
assert !"toto".is_email?
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_exceptions
|
55
|
+
assert_raise { RubyEmail::Rfc5322.match 1 }
|
56
|
+
assert_raise { RubyEmail::Rfc5322.validates? 1.0 }
|
57
|
+
assert_raise { RubyEmail::Rfc5322.validates? /toto/ }
|
58
|
+
assert_raise { RubyEmail::Rfc5322.validates? :ok }
|
59
|
+
assert_raise { RubyEmail::Rfc5322.validates? Class }
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
class TestRubyEmailRfc5322Public < Test::Unit::TestCase
|
65
|
+
def test_simpe
|
66
|
+
assert RubyEmail::Rfc5322::Public.validates?("toto@toto.toto")
|
67
|
+
assert RubyEmail::Rfc5322::Public.validates?("toto@toto.toto.toto")
|
68
|
+
assert RubyEmail::Rfc5322::Public.validates?("toto@toto.toto.toto.toto")
|
69
|
+
assert !RubyEmail::Rfc5322::Public.validates?("toto@toto")
|
70
|
+
assert RubyEmail::Rfc5322::Public.match("toto@toto.toto")
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_string
|
74
|
+
assert_raise { "toto@toto.toto".is_public_email? }
|
75
|
+
require_relative '../lib/ruby_email/rfc5322/public/string'
|
76
|
+
assert "toto@toto.toto".is_public_email?
|
77
|
+
assert !"toto@toto".is_public_email?
|
78
|
+
end
|
79
|
+
end
|
data/test/unit_test.rb
CHANGED
@@ -4,76 +4,5 @@ require "test/unit"
|
|
4
4
|
|
5
5
|
require_relative '../lib/ruby_email'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
def test_simple_true
|
10
|
-
assert RubyEmail::Rfc5322.validates?("toto@toto")
|
11
|
-
assert RubyEmail::Rfc5322.validates?("toto@toto.toto")
|
12
|
-
assert RubyEmail::Rfc5322.validates?("toto@toto.toto.toto")
|
13
|
-
assert RubyEmail::Rfc5322.validates?("toto@toto.toto.toto.toto")
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_simple_false
|
17
|
-
assert !RubyEmail::Rfc5322.validates?("t")
|
18
|
-
assert !RubyEmail::Rfc5322.validates?("t@")
|
19
|
-
assert !RubyEmail::Rfc5322.validates?("@t")
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_plus_true
|
23
|
-
assert RubyEmail::Rfc5322.validates?("i'am%toto@here")
|
24
|
-
assert RubyEmail::Rfc5322.validates?("ich-bin-toto@___")
|
25
|
-
assert RubyEmail::Rfc5322.validates?("arthur+spam@mail.com")
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_plus_false
|
29
|
-
assert !RubyEmail::Rfc5322.validates?("i have @ some things")
|
30
|
-
assert !RubyEmail::Rfc5322.validates?("toto;toto@toto;toto")
|
31
|
-
assert !RubyEmail::Rfc5322.validates?("toto,toto@toto,toto")
|
32
|
-
assert !RubyEmail::Rfc5322.validates?("toto()toto@toto()toto")
|
33
|
-
assert !RubyEmail::Rfc5322.validates?("toto[]toto@toto[]toto")
|
34
|
-
assert !RubyEmail::Rfc5322.validates?("toto:toto@toto:toto")
|
35
|
-
assert !RubyEmail::Rfc5322.validates?("toto<>toto@toto<>toto")
|
36
|
-
assert !RubyEmail::Rfc5322.validates?("toto\\toto@toto\\toto")
|
37
|
-
assert !RubyEmail::Rfc5322.validates?("toto\"toto@toto\"toto")
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_match
|
41
|
-
m = RubyEmail::Rfc5322.match "toto@toto.toto.toto.toto"
|
42
|
-
assert m.names & %w(local domain)
|
43
|
-
assert_equal "toto", m["local"]
|
44
|
-
assert_equal "toto.toto.toto.toto", m["domain"]
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_string
|
48
|
-
assert_raise { "toto@toto".is_email? }
|
49
|
-
require_relative '../lib/ruby_email/rfc5322/string'
|
50
|
-
assert "toto@toto".is_email?
|
51
|
-
assert !"toto".is_email?
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_exceptions
|
55
|
-
assert_raise { RubyEmail::Rfc5322.match 1 }
|
56
|
-
assert_raise { RubyEmail::Rfc5322.validates? 1.0 }
|
57
|
-
assert_raise { RubyEmail::Rfc5322.validates? /toto/ }
|
58
|
-
assert_raise { RubyEmail::Rfc5322.validates? :ok }
|
59
|
-
assert_raise { RubyEmail::Rfc5322.validates? Class }
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
class TestRubyEmailPublic < Test::Unit::TestCase
|
65
|
-
def test_simpe
|
66
|
-
assert RubyEmail::Rfc5322::Public.validates?("toto@toto.toto")
|
67
|
-
assert RubyEmail::Rfc5322::Public.validates?("toto@toto.toto.toto")
|
68
|
-
assert RubyEmail::Rfc5322::Public.validates?("toto@toto.toto.toto.toto")
|
69
|
-
assert !RubyEmail::Rfc5322::Public.validates?("toto@toto")
|
70
|
-
assert RubyEmail::Rfc5322::Public.match("toto@toto.toto")
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_string
|
74
|
-
assert_raise { "toto@toto.toto".is_public_email? }
|
75
|
-
require_relative '../lib/ruby_email/rfc5322/public/string'
|
76
|
-
assert "toto@toto.toto".is_public_email?
|
77
|
-
assert !"toto@toto".is_public_email?
|
78
|
-
end
|
79
|
-
end
|
7
|
+
require_relative 'rfc5322'
|
8
|
+
require_relative 'rfc1123'
|
data/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nephos (poulet_a)
|
@@ -61,11 +61,17 @@ files:
|
|
61
61
|
- Rakefile
|
62
62
|
- lib/ruby_email.rb
|
63
63
|
- lib/ruby_email/core.rb
|
64
|
+
- lib/ruby_email/rfc1123.rb
|
65
|
+
- lib/ruby_email/rfc1123/public.rb
|
66
|
+
- lib/ruby_email/rfc1123/public/string.rb
|
67
|
+
- lib/ruby_email/rfc1123/string.rb
|
64
68
|
- lib/ruby_email/rfc5322.rb
|
65
69
|
- lib/ruby_email/rfc5322/public.rb
|
66
70
|
- lib/ruby_email/rfc5322/public/string.rb
|
67
71
|
- lib/ruby_email/rfc5322/string.rb
|
68
72
|
- ruby_email.gemspec
|
73
|
+
- test/rfc1123.rb
|
74
|
+
- test/rfc5322.rb
|
69
75
|
- test/unit_test.rb
|
70
76
|
- version
|
71
77
|
homepage: https://github.com/Nephos/RubyEmail
|
metadata.gz.sig
CHANGED
Binary file
|