email-verification 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/lib/email/verification/base.rb +6 -4
- data/lib/email/verification/gmail.rb +5 -2
- data/lib/email/verification/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 702f0833319b309cd3965f937dc4fc227c49a4d8be80f74189fd8b5c9bab8d3e
|
4
|
+
data.tar.gz: 6993c38b5add429ad7414fb45c8b25fc50da26ccb341578c0723a08091279caa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f70cc1ed87d500a6b24780833bee31a4b71ce60ee34cc040650835316e6e6548c7cd80f32f692195a0d40ae1234892fd0c9587c93a01135366c5d5e2522ba6
|
7
|
+
data.tar.gz: 9f91d48d9339116f82cbad905b0233f515f4dc4b223b391e1c515a3f78c7d973c0ac0997f86ccfcfda9be51beb971b95b757853ad2a4aa5a9d7149650236b9d3
|
@@ -25,11 +25,13 @@ module Email
|
|
25
25
|
log("From: #{email.from&.first&.strip}. Subject: #{email.subject}")
|
26
26
|
|
27
27
|
if settings_provided?(settings)
|
28
|
-
|
29
|
-
|
28
|
+
matching_subject = settings[:subject].nil? || (!settings[:subject].nil? && email.subject =~ settings[:subject])
|
29
|
+
|
30
|
+
if email.from&.first&.strip == settings[:address] && matching_subject
|
31
|
+
emails << (email.html_part || email.text_part || email).body.decoded
|
30
32
|
end
|
31
33
|
else
|
32
|
-
emails
|
34
|
+
emails << (email.html_part || email.text_part || email).body.decoded
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -40,7 +42,7 @@ module Email
|
|
40
42
|
|
41
43
|
if settings_provided?(settings)
|
42
44
|
message = emails&.first
|
43
|
-
code = message&.match(settings[:regex])&.[](:match)
|
45
|
+
code = message&.match(settings[:regex])&.[](:match)
|
44
46
|
else
|
45
47
|
result = emails
|
46
48
|
end
|
@@ -13,8 +13,11 @@ module Email
|
|
13
13
|
gmail.inbox.emails(args).each do |email|
|
14
14
|
log("Email - from: #{email.from.first.name}, subject: #{email.subject}")
|
15
15
|
|
16
|
-
if settings_provided?(settings)
|
17
|
-
|
16
|
+
if settings_provided?(settings)
|
17
|
+
matching_name = settings[:from].to_s.empty? || (!settings[:from].to_s.empty? && email.from.first.name == settings[:from])
|
18
|
+
matching_subject = settings[:subject].nil? || (!settings[:subject].nil? && email.subject =~ settings[:subject])
|
19
|
+
|
20
|
+
if matching_name && matching_subject
|
18
21
|
emails << (email.html_part || email.text_part || email).body.decoded
|
19
22
|
email.read! if mark_as_read
|
20
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email-verification
|
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
|
- Sebastian Johnsson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gmail
|