brite_verify 0.0.2 → 0.0.3
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.
- checksums.yaml +7 -0
- data/README.md +7 -9
- data/Rakefile +1 -1
- data/brite_verify.gemspec +9 -10
- data/lib/brite_verify/email_fetcher.rb +9 -7
- data/lib/brite_verify/version.rb +1 -1
- data/test/email_fetcher_test.rb +6 -5
- data/test/email_response_test.rb +4 -4
- data/test/email_test.rb +39 -36
- data/test/test_helper.rb +0 -3
- metadata +37 -58
- data.tar.gz.sig +0 -1
- data/gem-public_cert.pem +0 -20
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 86fd959a7b28e7efa8870e756c55953255e64c38ab4eecd0dc13311ca6b5ae5a
|
4
|
+
data.tar.gz: 296f2f1a19fea96df3f87bfc31e5883cac4faf646e4f8351f3c3536b39130320
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b8db2c52fcc9fbe5a0b24336aabeff756ca5748d0243c0b9412a65b15d7ddbc760138dce1797f4d369bff405dc6625451615fb613e7ebeddacf69adad81c8e4b
|
7
|
+
data.tar.gz: ce40dda7acaca99af43cc8f4f1e377c590a768f5e8c6b05bf260582b26afd46a41e3726d4158bd0dc21ab8bbe2dd3983261c8188f9b1b776d27d18cad2e43046
|
data/README.md
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# BriteVerify
|
2
2
|
|
3
|
-
[BriteVerify](http://www.briteverify.com/) is a paying e-mail verification service. You pass it an e-mail address and it tells you if the e-mail address is real or not. They offer a typical REST
|
3
|
+
[BriteVerify](http://www.briteverify.com/) is a paying e-mail verification service. You pass it an e-mail address and it tells you if the e-mail address is real or not. They offer a typical REST-like API. This gem wraps the API in a more Ruby friendly syntax.
|
4
4
|
|
5
|
-
This gem is no way endorsed or certified by BriteVerify. I extracted the code from a project where we are using the BriteVerify e-mail verification service.
|
5
|
+
This gem is in no way endorsed or certified by BriteVerify. I extracted the code from a project where we are using the BriteVerify e-mail verification service.
|
6
6
|
|
7
7
|
## Shortcomings
|
8
8
|
|
9
|
-
This gem does not cover all of BriteVerify
|
9
|
+
This gem does not cover all of BriteVerify’s services. It only does e-mail verification and does not help you with any of BriteVerify’s other services as I did not need any of those so far. Feel free to contribute if you can help, it can only help the Ruby community.
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
13
|
-
The BriteVerify gem is Ruby
|
13
|
+
The BriteVerify gem is Ruby 2.x compatible.
|
14
14
|
|
15
|
-
Add this line to your application
|
15
|
+
Add this line to your application’s Gemfile:
|
16
16
|
|
17
17
|
gem 'brite_verify'
|
18
18
|
|
@@ -22,7 +22,7 @@ And then execute:
|
|
22
22
|
|
23
23
|
Or install it yourself as:
|
24
24
|
|
25
|
-
$ gem install
|
25
|
+
$ gem install brite_verify
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
@@ -52,9 +52,7 @@ email.error
|
|
52
52
|
=> "Email domain invalid"
|
53
53
|
```
|
54
54
|
|
55
|
-
You can skip the API key parameter and specify the `
|
56
|
-
|
57
|
-
A more detailed description of the API can be found in the [BriteVerify e-mail documentation](https://github.com/BriteVerify/BriteCode/blob/master/email.md).
|
55
|
+
You can skip the API key parameter and specify the `BRITEVERIFY_API_KEY` environment variable for convenience. The connection timeouts can be configured via the `BRITEVERIFY_READ_TIMEOUT` and `BRITEVERIFY_CONTINUE_TIMEOUT` environment variables.
|
58
56
|
|
59
57
|
## Contributing
|
60
58
|
|
data/Rakefile
CHANGED
data/brite_verify.gemspec
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "brite_verify/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "brite_verify"
|
8
8
|
gem.version = BriteVerify::VERSION
|
9
|
+
gem.licenses = ["MIT"]
|
9
10
|
gem.authors = ["Simon Schoeters"]
|
10
|
-
gem.email = ["
|
11
|
-
gem.description = %q{Ruby interface for BriteVerify
|
12
|
-
gem.summary = %q{BriteVerify is a paying e-mail verification service. You pass it an e-mail address and it tells you if the e-mail address is real or not. They offer a typical REST
|
11
|
+
gem.email = ["https://github.com/cimm/brite_verify/issues"]
|
12
|
+
gem.description = %q{Ruby interface for BriteVerify’s paying e-mail verification service.}
|
13
|
+
gem.summary = %q{BriteVerify is a paying e-mail verification service. You pass it an e-mail address and it tells you if the e-mail address is real or not. They offer a typical REST-like API. This gem wraps the API in a more Ruby friendly syntax.}
|
13
14
|
gem.homepage = "https://github.com/cimm/brite_verify"
|
14
15
|
|
15
16
|
gem.files = `git ls-files`.split($/)
|
@@ -17,9 +18,7 @@ Gem::Specification.new do |gem|
|
|
17
18
|
gem.test_files = gem.files.grep(%r{^(test)/})
|
18
19
|
gem.require_paths = ["lib"]
|
19
20
|
|
20
|
-
gem.
|
21
|
-
gem.
|
22
|
-
|
23
|
-
gem.add_development_dependency 'webmock', '~> 1.9.0'
|
24
|
-
gem.add_development_dependency 'rake', '~> 10.0.3'
|
21
|
+
gem.add_development_dependency "minitest", "~> 5.14"
|
22
|
+
gem.add_development_dependency "rake", "~> 13.0"
|
23
|
+
gem.add_development_dependency "webmock", "~> 3.11"
|
25
24
|
end
|
@@ -13,17 +13,19 @@ module BriteVerify
|
|
13
13
|
def fetch_raw_email(address)
|
14
14
|
email_response = fetch_email(address)
|
15
15
|
email_response.raw_email
|
16
|
-
rescue Timeout::Error
|
16
|
+
rescue Timeout::Error
|
17
17
|
{}
|
18
18
|
end
|
19
19
|
|
20
20
|
def fetch_email(address)
|
21
|
-
uri
|
22
|
-
http
|
23
|
-
http.use_ssl
|
24
|
-
http.
|
25
|
-
|
26
|
-
|
21
|
+
uri = verification_uri(address)
|
22
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
23
|
+
http.use_ssl = true
|
24
|
+
http.read_timeout = ENV.fetch("BRITEVERIFY_READ_TIMEOUT", 60).to_i
|
25
|
+
http.continue_timeout = ENV.fetch("BRITEVERIFY_CONTINUE_TIMEOUT", 60).to_i
|
26
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
27
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
28
|
+
response = http.request(request)
|
27
29
|
EmailResponse.new(response)
|
28
30
|
end
|
29
31
|
|
data/lib/brite_verify/version.rb
CHANGED
data/test/email_fetcher_test.rb
CHANGED
@@ -11,18 +11,19 @@ module BriteVerify
|
|
11
11
|
|
12
12
|
it "accepts a key" do
|
13
13
|
email_fetcher = EmailFetcher.new(KEY)
|
14
|
-
email_fetcher.wont_be_nil
|
14
|
+
_(email_fetcher).wont_be_nil
|
15
15
|
end
|
16
16
|
|
17
17
|
it "requires a key" do
|
18
|
-
lambda { EmailFetcher.new }
|
18
|
+
fetcher = lambda { EmailFetcher.new }
|
19
|
+
_(fetcher).must_raise(ArgumentError)
|
19
20
|
end
|
20
21
|
|
21
22
|
describe :fetch_raw_email do
|
22
23
|
it "returns the raw e-mail" do
|
23
24
|
email_fetcher = EmailFetcher.new(KEY)
|
24
25
|
parsed_valid_email_body = JSON.parse(valid_email_body)
|
25
|
-
email_fetcher.fetch_raw_email(ADDRESS).must_equal(parsed_valid_email_body)
|
26
|
+
_(email_fetcher.fetch_raw_email(ADDRESS)).must_equal(parsed_valid_email_body)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
@@ -35,7 +36,7 @@ module BriteVerify
|
|
35
36
|
|
36
37
|
it "returns an e-mail response" do
|
37
38
|
email_fetcher = EmailFetcher.new(KEY)
|
38
|
-
email_fetcher.fetch_email(ADDRESS).must_be_instance_of(EmailResponse)
|
39
|
+
_(email_fetcher.fetch_email(ADDRESS)).must_be_instance_of(EmailResponse)
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
@@ -43,7 +44,7 @@ module BriteVerify
|
|
43
44
|
it "returns the verification URI" do
|
44
45
|
email_fetcher = EmailFetcher.new(KEY)
|
45
46
|
uri = email_fetcher.verification_uri(ADDRESS)
|
46
|
-
uri.to_s.must_equal("https://bpi.briteverify.com/emails.json?address=john.doe%40example.com&apikey=123-abc-123-abc")
|
47
|
+
_(uri.to_s).must_equal("https://bpi.briteverify.com/emails.json?address=john.doe%40example.com&apikey=123-abc-123-abc")
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
data/test/email_response_test.rb
CHANGED
@@ -11,7 +11,7 @@ module BriteVerify
|
|
11
11
|
describe "when it succeeded" do
|
12
12
|
it "returns true" do
|
13
13
|
email_response = EmailResponse.new(@response)
|
14
|
-
email_response.successful
|
14
|
+
_(email_response.successful?).must_equal(true)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -22,7 +22,7 @@ module BriteVerify
|
|
22
22
|
|
23
23
|
it "returns false" do
|
24
24
|
email_response = EmailResponse.new(@response)
|
25
|
-
email_response.successful
|
25
|
+
_(email_response.successful?).must_equal(false)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -38,7 +38,7 @@ module BriteVerify
|
|
38
38
|
it "returns the raw email" do
|
39
39
|
email_response = EmailResponse.new(@response)
|
40
40
|
parsed_valid_email_body = JSON.parse(valid_email_body)
|
41
|
-
email_response.raw_email.must_equal(parsed_valid_email_body)
|
41
|
+
_(email_response.raw_email).must_equal(parsed_valid_email_body)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -49,7 +49,7 @@ module BriteVerify
|
|
49
49
|
|
50
50
|
it "returns an empty raw email" do
|
51
51
|
email_response = EmailResponse.new(@response)
|
52
|
-
email_response.raw_email.must_equal({})
|
52
|
+
_(email_response.raw_email).must_equal({})
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
data/test/email_test.rb
CHANGED
@@ -12,21 +12,24 @@ module BriteVerify
|
|
12
12
|
|
13
13
|
it "accepts a key" do
|
14
14
|
email = Email.new(ADDRESS, KEY)
|
15
|
-
email.wont_be_nil
|
15
|
+
_(email).wont_be_nil
|
16
16
|
end
|
17
17
|
|
18
18
|
it "requires a key" do
|
19
19
|
ENV['BRITEVERIFY_API_KEY'] = nil
|
20
|
-
lambda { Email.new(ADDRESS) }
|
20
|
+
email = lambda { Email.new(ADDRESS) }
|
21
|
+
_(email).must_raise(ArgumentError)
|
21
22
|
end
|
22
23
|
|
23
24
|
it "does not accept an empty key" do
|
24
|
-
lambda { Email.new(ADDRESS, "") }
|
25
|
+
email = lambda { Email.new(ADDRESS, "") }
|
26
|
+
_(email).must_raise(ArgumentError)
|
25
27
|
end
|
26
28
|
|
27
29
|
it "uses the environment variable the key wasn't given" do
|
28
30
|
ENV['BRITEVERIFY_API_KEY'] = "456-def-456-def"
|
29
|
-
lambda { Email.new(ADDRESS) }
|
31
|
+
email = lambda { Email.new(ADDRESS) }
|
32
|
+
_(email).must_be_silent
|
30
33
|
ENV['BRITEVERIFY_API_KEY'] = nil
|
31
34
|
end
|
32
35
|
|
@@ -34,7 +37,7 @@ module BriteVerify
|
|
34
37
|
describe "when the response was successful" do
|
35
38
|
it "returns true" do
|
36
39
|
email = Email.new(ADDRESS, KEY)
|
37
|
-
email.verified
|
40
|
+
_(email.verified?).must_equal(true)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
@@ -45,7 +48,7 @@ module BriteVerify
|
|
45
48
|
|
46
49
|
it "returns false" do
|
47
50
|
email = Email.new(ADDRESS, KEY)
|
48
|
-
email.verified
|
51
|
+
_(email.verified?).must_equal(false)
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
@@ -56,7 +59,7 @@ module BriteVerify
|
|
56
59
|
|
57
60
|
it "returns false" do
|
58
61
|
email = Email.new(ADDRESS, KEY)
|
59
|
-
email.verified
|
62
|
+
_(email.verified?).must_equal(false)
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
@@ -67,7 +70,7 @@ module BriteVerify
|
|
67
70
|
|
68
71
|
it "returns false" do
|
69
72
|
email = Email.new(ADDRESS, KEY)
|
70
|
-
email.verified
|
73
|
+
_(email.verified?).must_equal(false)
|
71
74
|
end
|
72
75
|
end
|
73
76
|
end
|
@@ -76,7 +79,7 @@ module BriteVerify
|
|
76
79
|
describe "when the response was successful" do
|
77
80
|
it "returns the verified address returned from BriteVerify" do
|
78
81
|
email = Email.new(ADDRESS, KEY)
|
79
|
-
email.address.must_equal("john.doe@example.com")
|
82
|
+
_(email.address).must_equal("john.doe@example.com")
|
80
83
|
end
|
81
84
|
end
|
82
85
|
|
@@ -87,7 +90,7 @@ module BriteVerify
|
|
87
90
|
|
88
91
|
it "returns nil" do
|
89
92
|
email = Email.new(ADDRESS, KEY)
|
90
|
-
email.address.must_be_nil
|
93
|
+
_(email.address).must_be_nil
|
91
94
|
end
|
92
95
|
end
|
93
96
|
end
|
@@ -96,7 +99,7 @@ module BriteVerify
|
|
96
99
|
describe "when the response was successful" do
|
97
100
|
it "returns the account returned from BriteVerify" do
|
98
101
|
email = Email.new(ADDRESS, KEY)
|
99
|
-
email.account.must_equal("john.doe")
|
102
|
+
_(email.account).must_equal("john.doe")
|
100
103
|
end
|
101
104
|
end
|
102
105
|
|
@@ -107,7 +110,7 @@ module BriteVerify
|
|
107
110
|
|
108
111
|
it "returns nil" do
|
109
112
|
email = Email.new(ADDRESS, KEY)
|
110
|
-
email.account.must_be_nil
|
113
|
+
_(email.account).must_be_nil
|
111
114
|
end
|
112
115
|
end
|
113
116
|
end
|
@@ -116,7 +119,7 @@ module BriteVerify
|
|
116
119
|
describe "when the response was successful" do
|
117
120
|
it "returns the domain returned from BriteVerify" do
|
118
121
|
email = Email.new(ADDRESS, KEY)
|
119
|
-
email.domain.must_equal("example.com")
|
122
|
+
_(email.domain).must_equal("example.com")
|
120
123
|
end
|
121
124
|
end
|
122
125
|
|
@@ -127,7 +130,7 @@ module BriteVerify
|
|
127
130
|
|
128
131
|
it "returns nil" do
|
129
132
|
email = Email.new(ADDRESS, KEY)
|
130
|
-
email.domain.must_be_nil
|
133
|
+
_(email.domain).must_be_nil
|
131
134
|
end
|
132
135
|
end
|
133
136
|
end
|
@@ -137,7 +140,7 @@ module BriteVerify
|
|
137
140
|
describe "when the address is valid" do
|
138
141
|
it "returns the valid status" do
|
139
142
|
email = Email.new(ADDRESS, KEY)
|
140
|
-
email.status.must_equal(:valid)
|
143
|
+
_(email.status).must_equal(:valid)
|
141
144
|
end
|
142
145
|
end
|
143
146
|
|
@@ -148,7 +151,7 @@ module BriteVerify
|
|
148
151
|
|
149
152
|
it "returns the invalid status" do
|
150
153
|
email = Email.new(ADDRESS, KEY)
|
151
|
-
email.status.must_equal(:invalid)
|
154
|
+
_(email.status).must_equal(:invalid)
|
152
155
|
end
|
153
156
|
end
|
154
157
|
|
@@ -159,7 +162,7 @@ module BriteVerify
|
|
159
162
|
|
160
163
|
it "returns the unknown status" do
|
161
164
|
email = Email.new(ADDRESS, KEY)
|
162
|
-
email.status.must_equal(:unknown)
|
165
|
+
_(email.status).must_equal(:unknown)
|
163
166
|
end
|
164
167
|
end
|
165
168
|
|
@@ -170,7 +173,7 @@ module BriteVerify
|
|
170
173
|
|
171
174
|
it "returns the unknown status" do
|
172
175
|
email = Email.new(ADDRESS, KEY)
|
173
|
-
email.status.must_equal(:accept_all)
|
176
|
+
_(email.status).must_equal(:accept_all)
|
174
177
|
end
|
175
178
|
end
|
176
179
|
end
|
@@ -182,7 +185,7 @@ module BriteVerify
|
|
182
185
|
|
183
186
|
it "returns nil" do
|
184
187
|
email = Email.new(ADDRESS, KEY)
|
185
|
-
email.status.must_be_nil
|
188
|
+
_(email.status).must_be_nil
|
186
189
|
end
|
187
190
|
end
|
188
191
|
end
|
@@ -196,14 +199,14 @@ module BriteVerify
|
|
196
199
|
|
197
200
|
it "returns true" do
|
198
201
|
email = Email.new(ADDRESS, KEY)
|
199
|
-
email.connected.must_equal(true)
|
202
|
+
_(email.connected).must_equal(true)
|
200
203
|
end
|
201
204
|
end
|
202
205
|
|
203
206
|
describe "when it is not known if the address is connected" do
|
204
207
|
it "returns nil" do
|
205
208
|
email = Email.new(ADDRESS, KEY)
|
206
|
-
email.connected.must_be_nil
|
209
|
+
_(email.connected).must_be_nil
|
207
210
|
end
|
208
211
|
end
|
209
212
|
end
|
@@ -215,7 +218,7 @@ module BriteVerify
|
|
215
218
|
|
216
219
|
it "returns nil" do
|
217
220
|
email = Email.new(ADDRESS, KEY)
|
218
|
-
email.connected.must_be_nil
|
221
|
+
_(email.connected).must_be_nil
|
219
222
|
end
|
220
223
|
end
|
221
224
|
end
|
@@ -224,7 +227,7 @@ module BriteVerify
|
|
224
227
|
describe "when the response was successful" do
|
225
228
|
it "returns the time it took BriteVerify to verify the address" do
|
226
229
|
email = Email.new(ADDRESS, KEY)
|
227
|
-
email.duration.must_equal(0.104516605)
|
230
|
+
_(email.duration).must_equal(0.104516605)
|
228
231
|
end
|
229
232
|
end
|
230
233
|
|
@@ -235,7 +238,7 @@ module BriteVerify
|
|
235
238
|
|
236
239
|
it "returns nil" do
|
237
240
|
email = Email.new(ADDRESS, KEY)
|
238
|
-
email.duration.must_be_nil
|
241
|
+
_(email.duration).must_be_nil
|
239
242
|
end
|
240
243
|
end
|
241
244
|
end
|
@@ -249,14 +252,14 @@ module BriteVerify
|
|
249
252
|
|
250
253
|
it "returns true" do
|
251
254
|
email = Email.new(ADDRESS, KEY)
|
252
|
-
email.disposable.must_equal(true)
|
255
|
+
_(email.disposable).must_equal(true)
|
253
256
|
end
|
254
257
|
end
|
255
258
|
|
256
259
|
describe "when it is not known if the address is disposable" do
|
257
260
|
it "returns nil" do
|
258
261
|
email = Email.new(ADDRESS, KEY)
|
259
|
-
email.disposable.must_be_nil
|
262
|
+
_(email.disposable).must_be_nil
|
260
263
|
end
|
261
264
|
end
|
262
265
|
end
|
@@ -268,7 +271,7 @@ module BriteVerify
|
|
268
271
|
|
269
272
|
it "returns nil" do
|
270
273
|
email = Email.new(ADDRESS, KEY)
|
271
|
-
email.disposable.must_be_nil
|
274
|
+
_(email.disposable).must_be_nil
|
272
275
|
end
|
273
276
|
end
|
274
277
|
end
|
@@ -282,14 +285,14 @@ module BriteVerify
|
|
282
285
|
|
283
286
|
it "returns true" do
|
284
287
|
email = Email.new(ADDRESS, KEY)
|
285
|
-
email.role_address.must_equal(true)
|
288
|
+
_(email.role_address).must_equal(true)
|
286
289
|
end
|
287
290
|
end
|
288
291
|
|
289
292
|
describe "when it is not known if the address is a role address" do
|
290
293
|
it "returns nil" do
|
291
294
|
email = Email.new(ADDRESS, KEY)
|
292
|
-
email.role_address.must_be_nil
|
295
|
+
_(email.role_address).must_be_nil
|
293
296
|
end
|
294
297
|
end
|
295
298
|
end
|
@@ -301,7 +304,7 @@ module BriteVerify
|
|
301
304
|
|
302
305
|
it "returns nil" do
|
303
306
|
email = Email.new(ADDRESS, KEY)
|
304
|
-
email.role_address.must_be_nil
|
307
|
+
_(email.role_address).must_be_nil
|
305
308
|
end
|
306
309
|
end
|
307
310
|
end
|
@@ -311,7 +314,7 @@ module BriteVerify
|
|
311
314
|
describe "when the address is valid" do
|
312
315
|
it "has no error code" do
|
313
316
|
email = Email.new(ADDRESS, KEY)
|
314
|
-
email.error_code.must_be_nil
|
317
|
+
_(email.error_code).must_be_nil
|
315
318
|
end
|
316
319
|
end
|
317
320
|
|
@@ -322,7 +325,7 @@ module BriteVerify
|
|
322
325
|
|
323
326
|
it "has an error code" do
|
324
327
|
email = Email.new(ADDRESS, KEY)
|
325
|
-
email.error_code.must_equal("email_domain_invalid")
|
328
|
+
_(email.error_code).must_equal("email_domain_invalid")
|
326
329
|
end
|
327
330
|
end
|
328
331
|
end
|
@@ -334,7 +337,7 @@ module BriteVerify
|
|
334
337
|
|
335
338
|
it "returns nil" do
|
336
339
|
email = Email.new(ADDRESS, KEY)
|
337
|
-
email.error_code.must_be_nil
|
340
|
+
_(email.error_code).must_be_nil
|
338
341
|
end
|
339
342
|
end
|
340
343
|
end
|
@@ -344,7 +347,7 @@ module BriteVerify
|
|
344
347
|
describe "when the address is valid" do
|
345
348
|
it "has no error" do
|
346
349
|
email = Email.new(ADDRESS, KEY)
|
347
|
-
email.error.must_be_nil
|
350
|
+
_(email.error).must_be_nil
|
348
351
|
end
|
349
352
|
end
|
350
353
|
|
@@ -355,7 +358,7 @@ module BriteVerify
|
|
355
358
|
|
356
359
|
it "has a more detailed error" do
|
357
360
|
email = Email.new(ADDRESS, KEY)
|
358
|
-
email.error.must_equal("Email domain invalid")
|
361
|
+
_(email.error).must_equal("Email domain invalid")
|
359
362
|
end
|
360
363
|
end
|
361
364
|
end
|
@@ -367,7 +370,7 @@ module BriteVerify
|
|
367
370
|
|
368
371
|
it "returns nil" do
|
369
372
|
email = Email.new(ADDRESS, KEY)
|
370
|
-
email.error.must_be_nil
|
373
|
+
_(email.error).must_be_nil
|
371
374
|
end
|
372
375
|
end
|
373
376
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'minitest/spec'
|
2
|
-
require 'minitest/mock'
|
3
1
|
require 'minitest/autorun'
|
4
2
|
require 'webmock/minitest'
|
5
3
|
require 'brite_verify'
|
@@ -41,7 +39,6 @@ def stub_email_verification_request(address, key, body)
|
|
41
39
|
end
|
42
40
|
|
43
41
|
def stub_error_email_verification_request(address, key, code)
|
44
|
-
status = []
|
45
42
|
verification_url = email_verification_url(address, key)
|
46
43
|
case code
|
47
44
|
when 401
|
metadata
CHANGED
@@ -1,90 +1,70 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brite_verify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Simon Schoeters
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
-
|
13
|
-
LS0tLS1CRUdJTiBDRVJUSU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QUFNQjBHQTFVZERn
|
29
|
-
UVdCQlRKNVRYeHdaT1UwZHZ0MFNmegpVZkNEMWxmeXdEQUxCZ05WSFE4RUJB
|
30
|
-
TUNCTEF3RFFZSktvWklodmNOQVFFRkJRQURnZ0VCQUJqTTJkQ1RpTEE0Ckdp
|
31
|
-
R3l6RjBPekNRY2pLNkVySWpLWWNaMDhzWG9QZWJzcnIwdU1CQkZDUTBibFFv
|
32
|
-
YmZDclVtcXpOTE5uK1JlaHYKRjlWaVNmSVNRUEJzZDBPVTZUTFpxbWhFTDJT
|
33
|
-
VDdIUUZQUlRQNUlaczhLWmlWZlJ2VEJPYjZCYmhzeUQ2YUdSLwo2WlIza1Mw
|
34
|
-
d1FLL3BDRFExMjlab2hrL2g5RWlkUVUwd0JIUFlqaEpkbEZoQ2thM2RXQ2JQ
|
35
|
-
djA5T3FnTFNkZnp4CmYzRUE4MU1hMzZnQ0wzenNHNk9TWmhSbTN1cm9EdzBU
|
36
|
-
dy9TaXVhU1QwOFZIZWdhVnRmL3JtVUZ6YVhFaGhGK3UKV2s0RHNtVEZjbTFI
|
37
|
-
N09XMzZVT09iMEtoVWZlNjhkU1VwTDdpMkVHT3J4UkxvdFpYWk1zd2NXSGY2
|
38
|
-
NXdvR1k5dQo1dGtDS25UMWhOcz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0t
|
39
|
-
LQo=
|
40
|
-
date: 2013-03-09 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-02-13 00:00:00.000000000 Z
|
41
12
|
dependencies:
|
42
13
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
14
|
+
name: minitest
|
44
15
|
requirement: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
16
|
requirements:
|
47
|
-
- - ~>
|
17
|
+
- - "~>"
|
48
18
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
19
|
+
version: '5.14'
|
50
20
|
type: :development
|
51
21
|
prerelease: false
|
52
22
|
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
23
|
requirements:
|
55
|
-
- - ~>
|
24
|
+
- - "~>"
|
56
25
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
26
|
+
version: '5.14'
|
58
27
|
- !ruby/object:Gem::Dependency
|
59
28
|
name: rake
|
60
29
|
requirement: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
30
|
requirements:
|
63
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: webmock
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
64
46
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
47
|
+
version: '3.11'
|
66
48
|
type: :development
|
67
49
|
prerelease: false
|
68
50
|
version_requirements: !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
51
|
requirements:
|
71
|
-
- - ~>
|
52
|
+
- - "~>"
|
72
53
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
74
|
-
description: Ruby interface for BriteVerify
|
54
|
+
version: '3.11'
|
55
|
+
description: Ruby interface for BriteVerify’s paying e-mail verification service.
|
75
56
|
email:
|
76
|
-
-
|
57
|
+
- https://github.com/cimm/brite_verify/issues
|
77
58
|
executables: []
|
78
59
|
extensions: []
|
79
60
|
extra_rdoc_files: []
|
80
61
|
files:
|
81
|
-
- .gitignore
|
62
|
+
- ".gitignore"
|
82
63
|
- Gemfile
|
83
64
|
- LICENSE.txt
|
84
65
|
- README.md
|
85
66
|
- Rakefile
|
86
67
|
- brite_verify.gemspec
|
87
|
-
- gem-public_cert.pem
|
88
68
|
- lib/brite_verify.rb
|
89
69
|
- lib/brite_verify/email.rb
|
90
70
|
- lib/brite_verify/email_fetcher.rb
|
@@ -102,31 +82,30 @@ files:
|
|
102
82
|
- test/fixtures/valid_email.json
|
103
83
|
- test/test_helper.rb
|
104
84
|
homepage: https://github.com/cimm/brite_verify
|
105
|
-
licenses:
|
85
|
+
licenses:
|
86
|
+
- MIT
|
87
|
+
metadata: {}
|
106
88
|
post_install_message:
|
107
89
|
rdoc_options: []
|
108
90
|
require_paths:
|
109
91
|
- lib
|
110
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
93
|
requirements:
|
113
|
-
- -
|
94
|
+
- - ">="
|
114
95
|
- !ruby/object:Gem::Version
|
115
96
|
version: '0'
|
116
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
-
none: false
|
118
98
|
requirements:
|
119
|
-
- -
|
99
|
+
- - ">="
|
120
100
|
- !ruby/object:Gem::Version
|
121
101
|
version: '0'
|
122
102
|
requirements: []
|
123
|
-
|
124
|
-
rubygems_version: 1.8.25
|
103
|
+
rubygems_version: 3.1.2
|
125
104
|
signing_key:
|
126
|
-
specification_version:
|
105
|
+
specification_version: 4
|
127
106
|
summary: BriteVerify is a paying e-mail verification service. You pass it an e-mail
|
128
107
|
address and it tells you if the e-mail address is real or not. They offer a typical
|
129
|
-
REST
|
108
|
+
REST-like API. This gem wraps the API in a more Ruby friendly syntax.
|
130
109
|
test_files:
|
131
110
|
- test/email_fetcher_test.rb
|
132
111
|
- test/email_response_test.rb
|
data.tar.gz.sig
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
�+($b������/*����*�'G���2R�Ubj��5
|
data/gem-public_cert.pem
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIDNDCCAhygAwIBAgIBADANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAloYW1m
|
3
|
-
aWx0ZXIxFTATBgoJkiaJk/IsZA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