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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc4669438d6c88db760bea1d85e9d19c5057782d023236c29dacbdbf3b5a1897
4
- data.tar.gz: c8eed2b71c6aa4ec60958d86a69a6dbcd7a42d4d0042fc361c3eec682adbb16d
3
+ metadata.gz: ef3bcc6748128ea37826390b2c33b061239709de97c8b44dde2ebf51184930e7
4
+ data.tar.gz: 3fc270a3265d3c7417ddfe433a64d06154c96dcf00164cc530a40c9a17420dcc
5
5
  SHA512:
6
- metadata.gz: 6c14ac2e596f4a72dff52cf8b3bc2bcc980eb864c85184388b977bffef20eaf71bfa3aa135b93ec7aa8b10d6993844121bc97a321d92f600f3f116b7ee5675a9
7
- data.tar.gz: 30416b73c74a9443bff72672e4b91d6b3d0095bdadc7729bb3fad47bf742f16827eb8cf0db17dbb7ac43da9e6145ecde94ac77974694ba86650acd0051d7bf09
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=minhquan4080/email_detected&utm_campaign=badger)
4
- [![CircleCI](https://circleci.com/gh/minhquan4080/email_detected/tree/master.svg?style=svg)](https://circleci.com/gh/minhquan4080/email_detected/tree/master)
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 = "youremail@email.com"
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['EMAIL_DETECTED'] || "nobody@nonexistant.com"
12
+ @verifier_email = ENV['SENDER_EMAIL_DETECTED'] || 'nobody@nonexistant.com'
11
13
  @test_mode = false
12
- if defined?(Rails) and defined?(Rails.env) and Rails.env.test?
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
- self.reset
19
+ reset
18
20
  end
19
21
  end
@@ -1,3 +1,3 @@
1
1
  module EmailDetected
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  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.2
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-04-04 00:00:00.000000000 Z
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: []