email_detected 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -5
- data/lib/email_detected/config.rb +5 -3
- data/lib/email_detected/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef3bcc6748128ea37826390b2c33b061239709de97c8b44dde2ebf51184930e7
|
4
|
+
data.tar.gz: 3fc270a3265d3c7417ddfe433a64d06154c96dcf00164cc530a40c9a17420dcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f276a0e99f66e7e6811a0623901d67c47b90f9b1e4e30c14821376932b29b6bf69d4f9e56ffc2c7960b24b18c94d128c68d7f3a4bab421e0df1756e32408e922
|
7
|
+
data.tar.gz: 75430eb5ac7a78163cfb025fb84cf4461ec470039156c8c458e8b0da417ab1255976b37de09d14ee3d85b23b95ce34544bf38577fd6e91827a36c5a4b24db815
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Email Detected
|
2
2
|
|
3
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5445a5fe4bca464c8f2b055e09e2fd73)](https://www.codacy.com/app/quanmn.libra/email_detected_2?utm_source=github.com&utm_medium=referral&utm_content=
|
4
|
-
[![CircleCI](https://circleci.com/gh/
|
3
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5445a5fe4bca464c8f2b055e09e2fd73)](https://www.codacy.com/app/quanmn.libra/email_detected_2?utm_source=github.com&utm_medium=referral&utm_content=dereknguyen269/email_detected&utm_campaign=badger)
|
4
|
+
[![CircleCI](https://circleci.com/gh/dereknguyen269/email_detected/tree/master.svg?style=svg)](https://circleci.com/gh/dereknguyen269/email_detected/tree/master)
|
5
5
|
|
6
6
|
Email Detected is a simple tool for verifying an email address exists. It's free and quite easy to use :smile: .
|
7
7
|
|
@@ -33,15 +33,24 @@ First thing you need to set up is placing something like this either in initiali
|
|
33
33
|
|
34
34
|
```ruby
|
35
35
|
EmailDetected.config do |config|
|
36
|
-
config.verifier_email =
|
36
|
+
config.verifier_email = ENV['SENDER_EMAIL_DETECTED']
|
37
37
|
end
|
38
38
|
```
|
39
39
|
|
40
|
+
Then, adding your **env** config with:
|
41
|
+
|
42
|
+
```bash
|
43
|
+
SENDER_EMAIL_DETECTED=your-real-email-config
|
44
|
+
```
|
45
|
+
|
46
|
+
Note: `verifier_email` must be **real**.
|
47
|
+
|
40
48
|
Then just put this in your model e. g:
|
41
49
|
|
42
50
|
```ruby
|
43
51
|
validates_exist_email_of :email
|
44
52
|
```
|
53
|
+
|
45
54
|
Or - if you'd like to use it outside of your models:
|
46
55
|
|
47
56
|
```ruby
|
@@ -49,13 +58,15 @@ EmailDetected.exist?(youremail)
|
|
49
58
|
```
|
50
59
|
|
51
60
|
This method will return with status `true || false` and `message` look like:
|
61
|
+
|
52
62
|
```
|
53
|
-
{:status=>true, :message=>"The email address has already been registered."}
|
63
|
+
{:status=>true, :message=>"The email address has already been registered."}
|
54
64
|
```
|
55
65
|
|
56
66
|
```
|
57
|
-
{:status=>false, :message=>"The email address invalid."}
|
67
|
+
{:status=>false, :message=>"The email address invalid."}
|
58
68
|
```
|
69
|
+
|
59
70
|
or will throw an exception with nicely detailed info about what's wrong.
|
60
71
|
|
61
72
|
## Development
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module EmailDetected
|
2
4
|
module Config
|
3
5
|
class << self
|
@@ -7,13 +9,13 @@ module EmailDetected
|
|
7
9
|
def reset
|
8
10
|
# This only needs to be something the receiving SMTP server
|
9
11
|
# accepts. We aren't actually sending any mail.
|
10
|
-
@verifier_email = ENV['
|
12
|
+
@verifier_email = ENV['SENDER_EMAIL_DETECTED'] || 'nobody@nonexistant.com'
|
11
13
|
@test_mode = false
|
12
|
-
if defined?(Rails)
|
14
|
+
if defined?(Rails) && defined?(Rails.env) && Rails.env.test?
|
13
15
|
@test_mode = true
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
17
|
-
|
19
|
+
reset
|
18
20
|
end
|
19
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_detected
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nguyen Quan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,7 +84,7 @@ homepage: https://github.com/dereknguyen269/email_detected
|
|
84
84
|
licenses:
|
85
85
|
- MIT
|
86
86
|
metadata: {}
|
87
|
-
post_install_message:
|
87
|
+
post_install_message:
|
88
88
|
rdoc_options: []
|
89
89
|
require_paths:
|
90
90
|
- lib
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubygems_version: 3.1.2
|
103
|
-
signing_key:
|
103
|
+
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Email Detected help checking email address is real.
|
106
106
|
test_files: []
|