valid8ors 0.1.1 → 0.1.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/valid8ors/email_format.rb +1 -1
- data/test/email_format_test.rb +4 -2
- data/valid8ors.gemspec +1 -1
- metadata +4 -4
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class EmailFormatValidator < ActiveModel::EachValidator
|
4
4
|
|
5
|
-
EMAIL_PATTERN = /\A[\w\-\+_
|
5
|
+
EMAIL_PATTERN = /\A[\w\-\+_]+(([.]?[\w\-\+_]+)*)?@(?<domain>(?:[\w\-\.]+\.)+[a-z]{2,})\Z/i
|
6
6
|
|
7
7
|
def validate_each(record, attribute, value)
|
8
8
|
if matching = EMAIL_PATTERN.match(value)
|
data/test/email_format_test.rb
CHANGED
@@ -100,7 +100,8 @@ class TestEmailFormatValidator < MiniTest::Unit::TestCase
|
|
100
100
|
'-words-here-to-increase-the-lenght-blah-blah-blah-blah-bla.org',
|
101
101
|
# 'bracketed-IP-instead-of-domain@[127.0.0.1]',
|
102
102
|
'local@sub.domains.com',
|
103
|
-
'first+last@domain.com'
|
103
|
+
'first+last@domain.com',
|
104
|
+
'dots.in.the.middle@domain.com'
|
104
105
|
]
|
105
106
|
end
|
106
107
|
|
@@ -134,7 +135,8 @@ class TestEmailFormatValidator < MiniTest::Unit::TestCase
|
|
134
135
|
'invalid-ip@127.0.0.1.26',
|
135
136
|
'another-invalid-ip@127.0.0.256',
|
136
137
|
'IP-and-port@127.0.0.1:25',
|
137
|
-
'ends.with.dot.@bar.com'
|
138
|
+
'ends.with.dot.@bar.com',
|
139
|
+
'.starts.with.dot@bar.com'
|
138
140
|
]
|
139
141
|
end
|
140
142
|
|
data/valid8ors.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "valid8ors"
|
6
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.2"
|
7
7
|
s.authors = ["Axel Vergult", "Vincent Pochet", "Ben Colon"]
|
8
8
|
s.email = ["axel@official.fm", "vincent@official.fm", "ben@official.fm"]
|
9
9
|
s.homepage = ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valid8ors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-11-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activemodel
|
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash:
|
77
|
+
hash: 632608919525334503
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
segments:
|
85
85
|
- 0
|
86
|
-
hash:
|
86
|
+
hash: 632608919525334503
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
89
|
rubygems_version: 1.8.24
|