blackstack-core 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/extend_float.rb +1 -1
  3. data/lib/functions.rb +16 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eb4cffe4ce2c4a57e17f89c59dd4e65a89bdf96ec411bb1c930fc388687f8d6
4
- data.tar.gz: f8cdd423961dcd522e3f155f2aa258f36758f8f23d12001e78fae240d127d2cb
3
+ metadata.gz: 9592570e271e03c770578f608c104b7e558a100b0b91255f7f75cf5fab7e4444
4
+ data.tar.gz: 6ed68ac325242d9322b245d0eb8bf2ab122e2382fd037fdd548d13803e5d0bbc
5
5
  SHA512:
6
- metadata.gz: 4d708e8c15d537530d75a1c0f54f37749766d9e2874d18cd6ab52d2c37492af028eedb52e912f84231e7c2748900d393b2ef95d227e7593a7782418b880a2387
7
- data.tar.gz: 156c970bf50cd2303fedce19a6255a5ed9fb712499c382059a58707d2b2fb9aa415090586be31466868f73bcea736822c95ab45e11d63d4981d08a971aa295b1
6
+ metadata.gz: 837d52cbacb341147b22bb6f7fee9788498aa9efebcbeaf27cd0040536b8d6c5c4a4fe2f7c0d59ddcbf4b782ebf733c5c6318b86a7875ca8735e1e1963e26613
7
+ data.tar.gz: 4cb67494f9c10e06c72b465fc916076e7d1955fd552f0793505f5bab409fd8761cac90f5f8e4fabb0694653a9f0545a35cd3a66221754313d9ac02d0829bd9ba
data/lib/extend_float.rb CHANGED
@@ -1,4 +1,4 @@
1
- class oat
1
+ class Float
2
2
  # Converts number to a string with a format like xx,xxx,xxx.xxxx
3
3
  def to_label()
4
4
  BlackStack::Number::Encoding::format_with_separator(self)
data/lib/functions.rb CHANGED
@@ -819,6 +819,22 @@ module BlackStack
819
819
  return a
820
820
  end
821
821
 
822
+ # raise an exception if `email` is not a valid email address.
823
+ # return an array with the companies who are hosting an email address, by running the linux command `host`.
824
+ def self.getMailHandler(email)
825
+ value = email
826
+ # raise an exception if the data type is an email, but the email is not valid.
827
+ raise "Email #{value} is not valid" if !value.email?
828
+ # extract the domain from the email
829
+ domain = value.split('@').last
830
+ # run the `host` command
831
+ s = `host -t mx #{domain}`
832
+ # extract the domains from the output
833
+ a = s.split("\n").map { |l| l.split.last }
834
+ # extract the company who is hosting the mail
835
+ a.map { |d| d.split('.').last(2).join('.') }.uniq
836
+ end
837
+
822
838
  end # module Netting
823
839
 
824
840
  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.5
4
+ version: 1.2.7
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-06-28 00:00:00.000000000 Z
11
+ date: 2023-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: content_spinning