blackstack-core 1.2.7 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extend_string.rb +14 -0
- data/lib/functions.rb +13 -0
- 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: 5c877e577233283db175f62ba92c4975a4cdac81f9ea44ecc76cdc1645ab30d6
|
4
|
+
data.tar.gz: 92f6bc2e8a72b0b56caed5a323c518066392be8a3a6fd9fd258a5e0faadadd95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38fbaf98892cbafc15d7e94ded840677e5fe1082531be91768fff2fbbee2e0475bb1a09be6541686d4be90c56118ac303a37b8286bca5f7689a29abdb6661b66
|
7
|
+
data.tar.gz: fd957c0c43e294885b08ef3805136c2a4acc720339d9fcfeba54f3da642ca141f5cc7b159643a6216cc4a8b28a0d20e99773f8168a76ea09d59416e4be70632b
|
data/lib/extend_string.rb
CHANGED
@@ -23,6 +23,20 @@ class String
|
|
23
23
|
return false
|
24
24
|
end
|
25
25
|
|
26
|
+
# raise an exception if `email` is not a valid email address.
|
27
|
+
# return if the email domain is gmail, hotmail, outlook, yahoo, comcast, aol, msn or sbcglobal.
|
28
|
+
def personal_email?
|
29
|
+
BlackStack::Netting.isPersonalEmail?(self.to_s)
|
30
|
+
end
|
31
|
+
|
32
|
+
# raise an exception if `email` is not a valid email address.
|
33
|
+
# return an array with the companies who are hosting an email address, by running the linux command `host`.
|
34
|
+
def mail_handler
|
35
|
+
BlackStack::Netting.getMailHandler(self.to_s)
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
|
26
40
|
# returns true if the string match with the regex of a domain
|
27
41
|
def domain?
|
28
42
|
return true if self.to_s =~ /^#{BlackStack::Strings::MATCH_DOMAIN}$/
|
data/lib/functions.rb
CHANGED
@@ -835,6 +835,19 @@ module BlackStack
|
|
835
835
|
a.map { |d| d.split('.').last(2).join('.') }.uniq
|
836
836
|
end
|
837
837
|
|
838
|
+
# raise an exception if `email` is not a valid email address.
|
839
|
+
# return if the email domain is gmail, hotmail, outlook, yahoo, comcast, aol, msn or sbcglobal.
|
840
|
+
def self.isPersonalEmail?(email)
|
841
|
+
value = email
|
842
|
+
# raise an exception if the data type is an email, but the email is not valid.
|
843
|
+
raise "Email #{value} is not valid" if !value.email?
|
844
|
+
# extract the domain from the email
|
845
|
+
domain = value.split('@').last
|
846
|
+
#
|
847
|
+
domain~=/gmail\.com/ || domain~=/hotmail\.com/ || domain~=/outlook\.com/ || domain~=/yahoo\.com/ || domain~=/comcast\.com/ || domain~=/aol\.com/ || domain~=/msn\.com/ || domain~=/sbcglobal\.net/
|
848
|
+
end
|
849
|
+
|
850
|
+
|
838
851
|
end # module Netting
|
839
852
|
|
840
853
|
end # module BlackStack
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blackstack-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: content_spinning
|