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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46498bfe9a730667a04d6defd887df5d2db1e2d9
4
- data.tar.gz: 8d82a1910be79a0301fb8bea538e48ce39e1783e
3
+ metadata.gz: 3a61b5f5394d7e3995cb72b8020ed8877539658f
4
+ data.tar.gz: e1781250b91b5b62faf766b6120c0e91ae2cbd0e
5
5
  SHA512:
6
- metadata.gz: 5021fee86809281a8931171f82cde476dc5aff110c904c0a6d1c1aa57b8c06757dcd77215d28c5c66cd43e27da643b58e241bfb1a930da0d5110f86a976a28a5
7
- data.tar.gz: 90b1b4a2b6b6cc9a7a80edbbf5adabd15ce0bb0218a289da766c40fe3d4ab53de192641cbaf946e769ce3dcf606ff0b7df638ac16b1e7181daf28c8e74d60847
6
+ metadata.gz: 7c0d25c20be026d62ef9bda3a775efe42e21f87be95323f3fbd5be16df2ed761d31066c0d54a3578ef1b7f22562e09df80152de910dd6a6517de936efce70279
7
+ data.tar.gz: 2c6bd876e48aa9f27ac6d2ce53942961b52207cfe508d80dad93cd9df2ed0b0d1bc346ca3fc1ff8c218463b499b7d2fa5630af5374c3df013aec9cce183d93b7
data/Changes.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # HEAD
2
2
 
3
+ # 1.6.0
4
+
5
+ * Unicode characters support [i7an #24]
6
+
3
7
  # 1.5.0
4
8
 
5
9
  * Add a class method for simpler validation [TiteiKo and cluesque #19]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{email_validator}
3
- s.version = "1.5.0"
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}
@@ -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] ? "-a-z0-9+._" : "^@\\s"
9
+ name_validation = options[:strict_mode] ? "-\\p{L}\\d+._" : "^@\\s"
9
10
 
10
- /\A\s*([#{name_validation}]{1,64})@((?:[-a-z0-9]+\.)+[a-z]{2,})\s*\z/i
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.5.0
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: 2014-12-08 00:00:00.000000000 Z
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.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+.