email_validator 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes.md +4 -0
- data/email_validator.gemspec +1 -1
- data/lib/email_validator.rb +3 -2
- data/spec/email_validator_spec.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a61b5f5394d7e3995cb72b8020ed8877539658f
|
4
|
+
data.tar.gz: e1781250b91b5b62faf766b6120c0e91ae2cbd0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c0d25c20be026d62ef9bda3a775efe42e21f87be95323f3fbd5be16df2ed761d31066c0d54a3578ef1b7f22562e09df80152de910dd6a6517de936efce70279
|
7
|
+
data.tar.gz: 2c6bd876e48aa9f27ac6d2ce53942961b52207cfe508d80dad93cd9df2ed0b0d1bc346ca3fc1ff8c218463b499b7d2fa5630af5374c3df013aec9cce183d93b7
|
data/Changes.md
CHANGED
data/email_validator.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{email_validator}
|
3
|
-
s.version = "1.
|
3
|
+
s.version = "1.6.0"
|
4
4
|
s.authors = ["Brian Alexander"]
|
5
5
|
s.description = %q{An email validator for Rails 3+. See homepage for details: http://github.com/balexand/email_validator}
|
6
6
|
s.email = %q{balexand@gmail.com}
|
data/lib/email_validator.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
# Based on work from http://thelucid.com/2010/01/08/sexy-validation-in-edge-rails-rails-3/
|
2
3
|
class EmailValidator < ActiveModel::EachValidator
|
3
4
|
@@default_options = {}
|
@@ -5,9 +6,9 @@ class EmailValidator < ActiveModel::EachValidator
|
|
5
6
|
def self.regexp(options = {})
|
6
7
|
options = default_options.merge(options)
|
7
8
|
|
8
|
-
name_validation = options[:strict_mode] ? "
|
9
|
+
name_validation = options[:strict_mode] ? "-\\p{L}\\d+._" : "^@\\s"
|
9
10
|
|
10
|
-
/\A\s*([#{name_validation}]{1,64})@((?:[
|
11
|
+
/\A\s*([#{name_validation}]{1,64})@((?:[-\p{L}\d]+\.)+\p{L}{2,})\s*\z/i
|
11
12
|
end
|
12
13
|
|
13
14
|
def self.valid?(value, options = {})
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
class TestUser < TestModel
|
@@ -47,7 +48,8 @@ describe EmailValidator do
|
|
47
48
|
"aaa@bbb.co.jp",
|
48
49
|
"nigel.worthington@big.co.uk",
|
49
50
|
"f@c.com",
|
50
|
-
"areallylongnameaasdfasdfasdfasdf@asdfasdfasdfasdfasdf.ab.cd.ef.gh.co.ca"
|
51
|
+
"areallylongnameaasdfasdfasdfasdf@asdfasdfasdfasdfasdf.ab.cd.ef.gh.co.ca",
|
52
|
+
"ящик@яндекс.рф"
|
51
53
|
].each do |email|
|
52
54
|
|
53
55
|
it "#{email.inspect} should be valid" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Alexander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.4.
|
94
|
+
rubygems_version: 2.4.5
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: An email validator for Rails 3+.
|