email_inquire 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  lib = File.expand_path("../lib", __FILE__)
@@ -12,11 +11,11 @@ Gem::Specification.new do |spec|
12
11
  spec.email = ["maxime.garcia@gmail.com"]
13
12
 
14
13
  spec.summary = "Library to validate email for format, common typos and one-time email providers"
15
- spec.description = "Library to validate email for format, common typos and one-time email providers"
14
+ spec.description = spec.summary
16
15
  spec.homepage = "https://github.com/maximeg/email_inquire"
17
16
  spec.license = "MIT"
18
17
 
19
- spec.required_ruby_version = ">= 2.0.0"
18
+ spec.required_ruby_version = ">= 2.3.0"
20
19
 
21
20
  spec.files =
22
21
  `git ls-files -z`.split("\x0").reject do |f|
@@ -26,10 +25,10 @@ Gem::Specification.new do |spec|
26
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
26
  spec.require_paths = ["lib"]
28
27
 
29
- spec.add_runtime_dependency "damerau-levenshtein", "~> 1.2"
28
+ spec.add_runtime_dependency("damerau-levenshtein", "~> 1.2")
30
29
 
31
- spec.add_development_dependency "bundler", "~> 1.15"
32
- spec.add_development_dependency "rake", "~> 10.0"
33
- spec.add_development_dependency "rubocop", "0.49.0"
34
- spec.add_development_dependency "rspec", "~> 3.6.0"
30
+ spec.add_development_dependency("bundler", "~> 1.15")
31
+ spec.add_development_dependency("rake", "~> 10.0")
32
+ spec.add_development_dependency("rspec", "~> 3.7.0")
33
+ spec.add_development_dependency("rubocop", "0.52.0")
35
34
  end
@@ -12,4 +12,24 @@ module EmailInquire
12
12
  inquirer.validate
13
13
  end
14
14
 
15
+ def self.custom_invalid_domains=(domains)
16
+ @@custom_invalid_domains =
17
+ case domains
18
+ when Set
19
+ domains
20
+ when Array
21
+ domains.to_set
22
+ when nil
23
+ Set.new
24
+ else
25
+ raise ArgumentError, "Unsupported type in `custom_invalid_domains=`"
26
+ end
27
+ end
28
+
29
+ def self.custom_invalid_domains
30
+ @@custom_invalid_domains ||= Set.new
31
+
32
+ @@custom_invalid_domains
33
+ end
34
+
15
35
  end
@@ -32,6 +32,7 @@ module EmailInquire
32
32
  validate_common_domains
33
33
  validate_one_time_providers
34
34
  validate_known_invalid_domains
35
+ validate_custom_invalid_domains
35
36
  validate_common_domain_mistakes
36
37
  validate_cc_tld
37
38
  validate_common_tld_mistakes
@@ -168,5 +169,9 @@ module EmailInquire
168
169
  response.invalid! if KNOWN_INVALID_DOMAINS.include?(domain)
169
170
  end
170
171
 
172
+ def validate_custom_invalid_domains
173
+ response.invalid! if EmailInquire.custom_invalid_domains.include?(domain)
174
+ end
175
+
171
176
  end
172
177
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module EmailInquire
4
4
 
5
- VERSION = "0.7.0"
5
+ VERSION = "0.8.0"
6
6
 
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_inquire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-27 00:00:00.000000000 Z
11
+ date: 2017-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: damerau-levenshtein
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.49.0
61
+ version: 3.7.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.49.0
68
+ version: 3.7.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec
70
+ name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 3.6.0
75
+ version: 0.52.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 3.6.0
82
+ version: 0.52.0
83
83
  description: Library to validate email for format, common typos and one-time email
84
84
  providers
85
85
  email:
@@ -92,6 +92,7 @@ files:
92
92
  - ".rspec"
93
93
  - ".rspec.travis"
94
94
  - ".rubocop.yml"
95
+ - ".ruby-version"
95
96
  - ".travis.yml"
96
97
  - CHANGELOG.md
97
98
  - Gemfile
@@ -101,6 +102,7 @@ files:
101
102
  - Rakefile
102
103
  - bin/console
103
104
  - bin/setup
105
+ - codecov.yml
104
106
  - data/br_tld.txt
105
107
  - data/common_providers.txt
106
108
  - data/jp_tld.txt
@@ -126,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
128
  requirements:
127
129
  - - ">="
128
130
  - !ruby/object:Gem::Version
129
- version: 2.0.0
131
+ version: 2.3.0
130
132
  required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  requirements:
132
134
  - - ">="
@@ -134,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
136
  version: '0'
135
137
  requirements: []
136
138
  rubyforge_project:
137
- rubygems_version: 2.6.12
139
+ rubygems_version: 2.7.4
138
140
  signing_key:
139
141
  specification_version: 4
140
142
  summary: Library to validate email for format, common typos and one-time email providers