useful_validators 0.0.1 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/Rakefile +2 -0
- data/lib/useful_validators/custom_email_validator.rb +18 -0
- data/lib/useful_validators/version.rb +3 -0
- data/lib/useful_validators.rb +4 -0
- data/useful_validators.gemspec +16 -0
- metadata +9 -2
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Andrey
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
module CustomEmailValidator
|
3
|
+
def self.email_regex
|
4
|
+
/\A#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}\z/i
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.email_name_regex
|
8
|
+
'[\w\.%\+\-]+'.freeze
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.domain_head_regex
|
12
|
+
'(?:[A-Z0-9\-]+\.)+'.freeze
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.domain_tld_regex
|
16
|
+
'(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum)'.freeze
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/useful_validators/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Andrey"]
|
6
|
+
gem.email = ["railscode@gmail.com"]
|
7
|
+
gem.description = "useful_validators"
|
8
|
+
gem.summary = "useful_validators"
|
9
|
+
gem.homepage = "https://github.com/vav/useful_validators.git"
|
10
|
+
gem.files = `git ls-files`.split($\)
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
+
gem.name = "useful_validators"
|
14
|
+
gem.require_paths = ["lib"]
|
15
|
+
gem.version = UsefulValidators::VERSION
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useful_validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -19,8 +19,15 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- .gitignore
|
22
|
+
- Gemfile
|
23
|
+
- LICENSE
|
22
24
|
- README.md
|
23
|
-
|
25
|
+
- Rakefile
|
26
|
+
- lib/useful_validators.rb
|
27
|
+
- lib/useful_validators/custom_email_validator.rb
|
28
|
+
- lib/useful_validators/version.rb
|
29
|
+
- useful_validators.gemspec
|
30
|
+
homepage: https://github.com/vav/useful_validators.git
|
24
31
|
licenses: []
|
25
32
|
post_install_message:
|
26
33
|
rdoc_options: []
|