SingleEmailVerification 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +28 -12
- data/SingleEmailVerification-0.1.0.gem +0 -0
- data/lib/emailVerification/version.rb +1 -1
- data/lib/emailVerification.rb +14 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385271c44c88aa965fe314b7736b875e1f073739205db1b5127e04a303bfe6f0
|
4
|
+
data.tar.gz: 580e9a690d812921b2c885cca533338fc3050007962532d6619ee715c301ae70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2e6d32a36755fdcabdc890a456b7ce0225deac29dcb5b87ac2d5c77add50082f0010f9090417c516d6771f37df12452cd857bf5031a4fd7647a73d6a5943434
|
7
|
+
data.tar.gz: 9bb0d0aa18ede2927fa4800e272e7d8edb958792cccc341757c07a9e6e9aecf054166422bb2047b8c8e20b51ddfa52e370250490e4255e269b5a3c72fa8e3866
|
data/README.md
CHANGED
@@ -1,39 +1,55 @@
|
|
1
1
|
# EmailVerification
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/emailVerification`. To experiment with that code, run `bin/console` for an interactive prompt.
|
3
|
+
The Single Email Verification Gem is a Ruby library that provides functionality to verify single email addresses. It allows you to easily integrate email verification into your Ruby applications.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
7
|
+
To install the gem, add the following line to your application's Gemfile:
|
8
|
+
|
9
|
+
$ gem install 'SingleEmailVerification'
|
10
10
|
|
11
11
|
Install the gem and add to the application's Gemfile by executing:
|
12
12
|
|
13
|
-
$ bundle
|
13
|
+
$ bundle nstall
|
14
14
|
|
15
15
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
16
|
|
17
|
-
$ gem install
|
17
|
+
$ gem install SingleEmailVerification
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
To use the Single Email Verification gem, require it in your Ruby code:
|
22
|
+
|
23
|
+
require 'emailVerification'
|
22
24
|
|
23
25
|
## Development
|
24
26
|
|
25
|
-
|
27
|
+
Then, create an instance of the EmailVerification::Client class and use its single_verify method to verify a single email address:
|
28
|
+
|
29
|
+
class ClientTest
|
30
|
+
|
31
|
+
def initialize
|
32
|
+
@client = EmailVerification::Client.new
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_single_verify
|
36
|
+
email = 'sahal.abdullah@mslm.io'
|
37
|
+
resp = @client.single_verify(email)
|
38
|
+
puts resp
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
26
42
|
|
27
|
-
|
43
|
+
ClientTest.new.test_single_verify
|
28
44
|
|
29
45
|
## Contributing
|
30
46
|
|
31
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sahalAbdullah/emailVerification. Please provide detailed descriptions and steps to reproduce any bugs you encounter.
|
32
48
|
|
33
49
|
## License
|
34
50
|
|
35
|
-
The gem is available as open source under the terms of the
|
51
|
+
The Single Email Verification gem is available as open source under the terms of the MIT License. You are free to use and modify it as per your requirements.
|
36
52
|
|
37
53
|
## Code of Conduct
|
38
54
|
|
39
|
-
Everyone interacting in the EmailVerification project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
55
|
+
Everyone interacting in the EmailVerification project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sahalAbdullah/emailVerification/blob/master/CODE_OF_CONDUCT.md).
|
Binary file
|
data/lib/emailVerification.rb
CHANGED
@@ -4,11 +4,16 @@ require 'json'
|
|
4
4
|
|
5
5
|
module EmailVerification
|
6
6
|
|
7
|
-
|
7
|
+
class SingleVerifyReqOpts
|
8
8
|
attr_accessor :disable_url_encode
|
9
|
+
attr_accessor :api_key
|
9
10
|
end
|
10
11
|
|
11
12
|
class Client
|
13
|
+
|
14
|
+
def initialize(api_key = nil)
|
15
|
+
@api_key = api_key
|
16
|
+
end
|
12
17
|
def single_verify(email_addr, opts = nil)
|
13
18
|
opt = SingleVerifyReqOpts.new
|
14
19
|
opt = opts.last unless opts.nil? || opts.empty?
|
@@ -17,7 +22,14 @@ module EmailVerification
|
|
17
22
|
email_addr = URI.encode_www_form_component(email_addr) unless opt.disable_url_encode
|
18
23
|
|
19
24
|
qp = { 'email' => email_addr }
|
25
|
+
if @api_key || opt.api_key
|
26
|
+
api_key = opt.api_key || @api_key
|
27
|
+
qp['apikey'] = api_key
|
28
|
+
end
|
29
|
+
|
30
|
+
|
20
31
|
t_url = prepare_url('https://mslm.io/api/sv/v1', qp, opt)
|
32
|
+
puts "Url #{t_url}"
|
21
33
|
|
22
34
|
sv_resp = req_and_resp('GET', t_url, nil, opt)
|
23
35
|
return sv_resp
|
@@ -44,7 +56,7 @@ module EmailVerification
|
|
44
56
|
response = [json_response["email"],json_response["username"],json_response["domain"],json_response["malformed"],json_response["suggestion"],json_response["status"],json_response["has_mailbox"],json_response["accept_all"],json_response["disposable"],json_response["free"],json_response["role"],json_response['mx']]
|
45
57
|
return response
|
46
58
|
else
|
47
|
-
|
59
|
+
return "HTTP #{response_data.code}: #{response_data.message}"
|
48
60
|
end
|
49
61
|
end
|
50
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SingleEmailVerification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sahal Abdullah
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Write a longer description or delete this line.
|
14
14
|
email:
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- LICENSE.txt
|
23
23
|
- README.md
|
24
24
|
- Rakefile
|
25
|
+
- SingleEmailVerification-0.1.0.gem
|
25
26
|
- emailVerification.gemspec
|
26
27
|
- lib/emailVerification.rb
|
27
28
|
- lib/emailVerification/version.rb
|