ruby_email 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26ff472ba47c45cd8b0edc4e84b38b1391f0b6d8
4
- data.tar.gz: 457c89bbfcefc1172696d851372db8c41a67915a
3
+ metadata.gz: 6ddad11ccb4144bd5bad65ca9bc92e8f790fdfd9
4
+ data.tar.gz: 3f82921b53c852986b0b1a033531e8beee214791
5
5
  SHA512:
6
- metadata.gz: 77b1b6a68386a934aea133a161b6d2c4c073f4453467ab6f6f20375b8791f55e9e57c2c7096f14ba4c807e3ff5eed6cda6cf3f33c20f7188b3bf017e2c554cc4
7
- data.tar.gz: 86d90bc23842e99a51215d8aa05d7462ee4695435d3535cced0b6fc9e8a9a59b4663b6729e17e1e4245cd04c04ed1d34a5bd99e3cf9a6d5a9640f2211187aa16
6
+ metadata.gz: cdc8fcd386b82b5c4b4ff997d6b7b8ba36109cf07eebb7fa9f812b71fd867e87ab90d9fa1301219804d264a092325c53f94ddb6d55f394c5dc70d39f3f0d5eed
7
+ data.tar.gz: a1c16a694d68f27b8955554b681279c7bf4bb9e375a08e7b9e5d4cc957d16bfcf351f43cae31c87ffe82818597ceeb9935b492c960b05c001f594d51e9fed64c
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.2.2
2
+ * Fix Rfc1123 regexp bug
3
+
1
4
  v0.2.1
2
5
  * Add certificates to the .gem archites too
3
6
 
data/README.md CHANGED
@@ -28,14 +28,14 @@ gem 'ruby_email'
28
28
  require 'ruby_email'
29
29
 
30
30
  # Pure Rfc5322
31
- RubyEmail::Rfc322.validates? "toto@tata" # => true
32
- RubyEmail::Rfc322.match "toto@tata" # => #<MatchData "toto@tata" local:"toto" domain:"tata">
33
- RubyEmail::Rfc322.validates? "toto" # => false
34
- RubyEmail::Rfc322.match "toto" # => nil
31
+ RubyEmail::Rfc5322.validates? "toto@tata" # => true
32
+ RubyEmail::Rfc5322.match "toto@tata" # => #<MatchData "toto@tata" local:"toto" domain:"tata">
33
+ RubyEmail::Rfc5322.validates? "toto" # => false
34
+ RubyEmail::Rfc5322.match "toto" # => nil
35
35
 
36
36
  # Rfc5322 + Internet basic usage
37
- RubyEmail::Rfc322::Public.validates? "toto@tata.com" # => true
38
- RubyEmail::Rfc322::Public.match "toto@tata.com" # => #<MatchData "toto@tata" local:"toto" domain:"tata.com">
37
+ RubyEmail::Rfc5322::Public.validates? "toto@tata.com" # => true
38
+ RubyEmail::Rfc5322::Public.match "toto@tata.com" # => #<MatchData "toto@tata" local:"toto" domain:"tata.com">
39
39
 
40
40
  # Rfc5322 Strings
41
41
  require 'ruby_email/rfc5322/string'
@@ -54,8 +54,8 @@ require 'ruby_email/rfc5322/public/string'
54
54
 
55
55
  ```ruby
56
56
  class Model < ActiveRecord::Base
57
- # validates :email, format: RubyEmail::Rfc322::REGEXP # valid on an intranet ...
58
- validates :email, format: RubyEmail::Rfc322::Public::REGEXP
57
+ # validates :email, format: RubyEmail::Rfc5322::REGEXP # valid on an intranet ...
58
+ validates :email, format: RubyEmail::Rfc5322::Public::REGEXP
59
59
  end
60
60
  ```
61
61
 
@@ -19,10 +19,10 @@ module RubyEmail
19
19
  # a valid string with subdomains, separated by dots for domain part as IPV4
20
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
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})"
22
+ DOT_ATOM_TEXT = "((#{ATOM_ALL}\\.)*#{ATOM_FIRST})"
23
23
 
24
24
  # email grammar
25
- VALIDE = "(?<domain>((#{DOT_ATOM_TEXT})|(#{IPV4})))"
25
+ VALIDE = "(?<domain>(?!.{254,})((#{DOT_ATOM_TEXT})|(#{IPV4})))"
26
26
 
27
27
  # regexp to validate complete email
28
28
  REGEXP = Regexp.new "\\A#{VALIDE}\\Z"
@@ -34,6 +34,7 @@ module RubyEmail
34
34
  RubyEmail::Rfc1123.validates? self
35
35
  end
36
36
  end
37
+
37
38
  end
38
39
 
39
40
  end
@@ -31,6 +31,7 @@ module RubyEmail
31
31
  RubyEmail::Rfc5322.validates? self
32
32
  end
33
33
  end
34
+
34
35
  end
35
36
 
36
37
  end
data/test/rfc1123.rb CHANGED
@@ -21,6 +21,10 @@ class TestRubyEmailRfc1123 < Test::Unit::TestCase
21
21
  assert RubyEmail::Rfc1123.validates?("1.toto")
22
22
  assert RubyEmail::Rfc1123.validates?("127.0.0.1")
23
23
  assert RubyEmail::Rfc1123.validates?("255.254.251.0")
24
+ assert RubyEmail::Rfc1123.validates?("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
25
+ assert RubyEmail::Rfc1123.validates?("a" * 63)
26
+ assert RubyEmail::Rfc1123.validates?("a" * 63 + ".a")
27
+ assert RubyEmail::Rfc1123.validates?("aaa" + ".a"*125)
24
28
  end
25
29
 
26
30
  def test_plus_false
@@ -41,6 +45,8 @@ class TestRubyEmailRfc1123 < Test::Unit::TestCase
41
45
  assert !RubyEmail::Rfc1123.validates?("111")
42
46
  assert !RubyEmail::Rfc1123.validates?("a.1")
43
47
  assert !RubyEmail::Rfc1123.validates?("1.1")
48
+ assert !RubyEmail::Rfc1123.validates?("a" * 64)
49
+ assert !RubyEmail::Rfc1123.validates?("aaaa" + ".a"*125)
44
50
  end
45
51
 
46
52
  def test_match
@@ -65,20 +71,3 @@ class TestRubyEmailRfc1123 < Test::Unit::TestCase
65
71
  end
66
72
 
67
73
  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 CHANGED
@@ -60,20 +60,3 @@ class TestRubyEmailRfc5322 < Test::Unit::TestCase
60
60
  end
61
61
 
62
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,5 +4,7 @@ require "test/unit"
4
4
 
5
5
  require_relative '../lib/ruby_email'
6
6
 
7
- require_relative 'rfc5322'
8
7
  require_relative 'rfc1123'
8
+ require_relative 'rfc1123_public'
9
+ require_relative 'rfc5322'
10
+ require_relative 'rfc5322_public'
data/version CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nephos (poulet_a)
@@ -31,7 +31,7 @@ cert_chain:
31
31
  tcYkgfqUJPitIJx1RvWZpIyH5uJhRUYK3+vU9nMOxez5WbIlC1TtpByKAPMX+sht
32
32
  gib3AoIT8jh/2w==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-05-03 00:00:00.000000000 Z
34
+ date: 2016-05-11 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nomorebeer
metadata.gz.sig CHANGED
Binary file