email_data 1601711723 → 1602274654

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,15 @@ abdumuhammadalitmp@gmail.com
2
2
  alissiabucknertmp@gmail.com
3
3
  andykingsolomontmp@gmail.com
4
4
  aypztmpcovdzylqkd@gmail.com
5
+ braylenmidletontmp@gmail.com
5
6
  chadfranciscojrtmp@gmail.com
6
7
  christianjosephtmp@gmail.com
7
8
  christopherjohntmp@gmail.com
8
9
  christopherpaultmp@gmail.com
10
+ deandregriffithtmp@gmail.com
11
+ emmettbradleytmp@gmail.com
9
12
  ezradiamondiquetmp@gmail.com
13
+ fletcheerharveytmp@gmail.com
10
14
  hannahelizabethtmp@gmail.com
11
15
  jackquelinebanetmp@gmail.com
12
16
  janerebeccalynntmp@gmail.com
@@ -20,11 +24,13 @@ laurenelizabethtmp@gmail.com
20
24
  leahmarykathryntmp@gmail.com
21
25
  luisgabrielcarltmp@gmail.com
22
26
  lynnvanessaannetmp@gmail.com
27
+ marcusguzmantmp@gmail.com
23
28
  mariadelosangeltmp@gmail.com
24
29
  mariadelrosariotmp@gmail.com
25
30
  markchristophertmp@gmail.com
26
31
  mfpstmpmaicdyhxkr@gmail.com
27
32
  mosktmpexreaiwftv@gmail.com
33
+ natashamendeztmp@gmail.com
28
34
  nathanluisjamestmp@gmail.com
29
35
  neilnathanjamestmp@gmail.com
30
36
  nicolemarieclaytmp@gmail.com
@@ -34,5 +40,9 @@ phillistinebanetmp@gmail.com
34
40
  seanbernardettetmp@gmail.com
35
41
  stellafortunatatmp@gmail.com
36
42
  tamikawilkinsontmp@gmail.com
43
+ terrancehowelltmp@gmail.com
44
+ tiffanynormantmp@gmail.com
45
+ tonysamueldavidtmp@gmail.com
37
46
  victoriannakoletmp@gmail.com
47
+ vihaanwhitfieldtmp@gmail.com
38
48
  xbgxtmpqwgztzcfav@gmail.com
@@ -612,7 +612,6 @@ institute
612
612
  insurance
613
613
  insure
614
614
  int
615
- intel
616
615
  international
617
616
  intuit
618
617
  investments
@@ -29,11 +29,12 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_development_dependency "activesupport"
32
+ spec.add_development_dependency "activerecord"
33
33
  spec.add_development_dependency "aitch"
34
34
  spec.add_development_dependency "bundler"
35
35
  spec.add_development_dependency "minitest"
36
36
  spec.add_development_dependency "minitest-utils"
37
+ spec.add_development_dependency "pg"
37
38
  spec.add_development_dependency "rake"
38
39
  spec.add_development_dependency "root_domain"
39
40
  spec.add_development_dependency "rubocop"
@@ -1,39 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "forwardable"
3
4
  require "pathname"
4
- require "email_data/version"
5
5
 
6
6
  module EmailData
7
- def self.data_dir
8
- Pathname.new(File.expand_path("../data", __dir__))
7
+ require "email_data/version"
8
+ require "email_data/source/file_system"
9
+
10
+ class << self
11
+ extend Forwardable
12
+
13
+ def_delegators :source,
14
+ :disposable_domains,
15
+ :disposable_emails,
16
+ :country_tlds,
17
+ :free_email_domains,
18
+ :tlds
9
19
  end
10
20
 
11
- def self.tlds
12
- @tlds ||= load_file("tlds.txt")
21
+ def self.source=(source)
22
+ @source = source
13
23
  end
14
24
 
15
- def self.country_tlds
16
- @country_tlds ||= load_file("country_tlds.txt")
25
+ def self.source
26
+ @source
17
27
  end
18
28
 
19
- def self.disposable_emails
20
- @disposable_emails ||= load_file("disposable_emails.txt")
21
- end
22
-
23
- def self.disposable_domains
24
- @disposable_domains ||= load_file("disposable_domains.txt")
25
- end
26
-
27
- def self.free_email_domains
28
- @free_email_domains ||= load_file("free_email_domains.txt")
29
+ def self.data_dir
30
+ Pathname.new(File.expand_path("../data", __dir__))
29
31
  end
30
32
 
31
- def self.load_file(filename)
32
- data_dir
33
- .join(filename)
34
- .read
35
- .lines
36
- .map(&:chomp)
37
- .reject(&:empty?)
38
- end
33
+ self.source = EmailData::Source::FileSystem
39
34
  end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "email_data"
4
+
5
+ begin
6
+ require "active_record"
7
+ rescue LoadError
8
+ raise "activerecord is not part of the bundle. Add it to Gemfile."
9
+ end
10
+
11
+ module EmailData
12
+ module Source
13
+ class ActiveRecord
14
+ class ApplicationRecord < ::ActiveRecord::Base
15
+ self.abstract_class = true
16
+ end
17
+
18
+ class TLD < ApplicationRecord
19
+ self.table_name = "tlds"
20
+ end
21
+
22
+ class CountryTLD < ApplicationRecord
23
+ self.table_name = "country_tlds"
24
+ end
25
+
26
+ class DisposableEmail < ApplicationRecord
27
+ self.table_name = "disposable_emails"
28
+ end
29
+
30
+ class DisposableDomain < ApplicationRecord
31
+ self.table_name = "disposable_domains"
32
+ end
33
+
34
+ class FreeEmailDomain < ApplicationRecord
35
+ self.table_name = "free_email_domains"
36
+ end
37
+
38
+ class Collection
39
+ def initialize(model)
40
+ @model = model
41
+ end
42
+
43
+ def include?(value)
44
+ @model.where(name: value).exists?
45
+ end
46
+
47
+ def each(&block)
48
+ @model.find_each(&block)
49
+ end
50
+ end
51
+
52
+ def self.tlds
53
+ @tlds ||= Collection.new(TLD)
54
+ end
55
+
56
+ def self.country_tlds
57
+ @country_tlds ||= Collection.new(CountryTLD)
58
+ end
59
+
60
+ def self.disposable_emails
61
+ @disposable_emails ||= Collection.new(DisposableEmail)
62
+ end
63
+
64
+ def self.disposable_domains
65
+ @disposable_domains ||= Collection.new(DisposableDomain)
66
+ end
67
+
68
+ def self.free_email_domains
69
+ @free_email_domains ||= Collection.new(FreeEmailDomain)
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EmailData
4
+ module Source
5
+ class FileSystem
6
+ def self.tlds
7
+ @tlds ||= load_file("tlds.txt")
8
+ end
9
+
10
+ def self.country_tlds
11
+ @country_tlds ||= load_file("country_tlds.txt")
12
+ end
13
+
14
+ def self.disposable_emails
15
+ @disposable_emails ||= load_file("disposable_emails.txt")
16
+ end
17
+
18
+ def self.disposable_domains
19
+ @disposable_domains ||= load_file("disposable_domains.txt")
20
+ end
21
+
22
+ def self.free_email_domains
23
+ @free_email_domains ||= load_file("free_email_domains.txt")
24
+ end
25
+
26
+ def self.load_file(filename)
27
+ EmailData
28
+ .data_dir
29
+ .join(filename)
30
+ .read
31
+ .lines
32
+ .map(&:chomp)
33
+ .reject(&:empty?)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fnando/email_data",
3
3
  "description": "This project is a compilation of datasets related to emails. Includes disposable emails, disposable domains, and free email services.",
4
- "version": "1601711723.0.0",
4
+ "version": "1602274654.0.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_data
3
3
  version: !ruby/object:Gem::Version
4
- version: '1601711723'
4
+ version: '1602274654'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-03 00:00:00.000000000 Z
11
+ date: 2020-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activesupport
14
+ name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pg
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rake
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -189,6 +203,8 @@ files:
189
203
  - data/tlds.txt
190
204
  - email_data.gemspec
191
205
  - lib/email_data.rb
206
+ - lib/email_data/source/active_record.rb
207
+ - lib/email_data/source/file_system.rb
192
208
  - lib/email_data/version.rb
193
209
  - package.json
194
210
  homepage: https://github.com/fnando/email_data