dns-sniper 0.0.1.pre7 → 0.0.1.pre8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 512e7b14734237f57edc560759f751a748083c2639fa4adc5beac81f460222f5
|
4
|
+
data.tar.gz: f1223fae9ec10a2b42c797dd43a1a874ac916f241272cb84526994994c82d621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93631146a7ae4eedf7fbe3d4275f5156a3cac90eb665f4c916c5b6e37977d23b91716bccae8074c8b5492fa0cc21607ebeafe246d9879f89627710c4bbff24d3
|
7
|
+
data.tar.gz: e7b9d0fc865c070561129f21aea1a936b21f5d357affeb8cc096946922059977640aea8d323035ddcc39737a31bef2d18d35d2aaa832fb90771fdcd3944b874e
|
data/dns-sniper.gemspec
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'dns-sniper'
|
5
5
|
spec.license = 'MIT'
|
6
|
-
spec.version = '0.0.1.
|
7
|
-
spec.date = '2021-
|
6
|
+
spec.version = '0.0.1.pre8'
|
7
|
+
spec.date = '2021-06-28'
|
8
8
|
|
9
9
|
spec.authors = ['Brody Hoskins']
|
10
10
|
spec.email = ['brody@brody.digital']
|
@@ -9,15 +9,15 @@ module DNSSniper
|
|
9
9
|
|
10
10
|
def import_file(path, list:)
|
11
11
|
raise ArgumentError, "#{self.class.name}: #from_path requies list to be defined" unless list
|
12
|
-
return []
|
12
|
+
return [] unless File.exist?(path)
|
13
13
|
|
14
14
|
yaml = YAML.safe_load(File.read(path), permitted_classes: [Symbol])
|
15
|
-
return []
|
15
|
+
return [] unless yaml.dig(:sources)&.dig(list.to_sym)
|
16
16
|
|
17
|
-
hostnames = []
|
17
|
+
hostnames = []
|
18
18
|
yaml.dig(:sources).dig(list.to_sym).each do |source|
|
19
|
-
return []
|
20
|
-
return []
|
19
|
+
return [] unless source.dig(:importer)
|
20
|
+
return [] unless source.dig(:uri)
|
21
21
|
|
22
22
|
importer = DNSSniper.const_get("#{source.dig(:importer).to_s.split('_').map(&:capitalize).join}Importer")
|
23
23
|
if !importer
|
@@ -3,20 +3,20 @@
|
|
3
3
|
module DNSSniper
|
4
4
|
class DomainsImporter < Importer
|
5
5
|
def import_file(path)
|
6
|
-
return []
|
6
|
+
return [] unless File.exist?(path)
|
7
7
|
|
8
|
-
File.open(path).readlines(chomp: true).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
8
|
+
File.open(path).readlines(chomp: true).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
9
9
|
end
|
10
10
|
|
11
11
|
def import_uri(uri)
|
12
12
|
begin
|
13
13
|
down = Down.download(uri)
|
14
|
-
return down.readlines(chomp: true).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
14
|
+
return down.readlines(chomp: true).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
15
15
|
rescue Down::InvalidUrl => e
|
16
16
|
warn "#{self.class.name}: #{e}"
|
17
17
|
end
|
18
18
|
|
19
|
-
[]
|
19
|
+
[]
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module DNSSniper
|
4
4
|
class HostsImporter < Importer
|
5
5
|
def import_file(path, *)
|
6
|
-
return []
|
6
|
+
return [] unless File.exist?(path)
|
7
7
|
|
8
|
-
HostsFile.load(path).map(&:name).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
8
|
+
HostsFile.load(path).map(&:name).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
9
9
|
end
|
10
10
|
|
11
11
|
def import_uri(uri, *)
|
@@ -17,10 +17,10 @@ module DNSSniper
|
|
17
17
|
end
|
18
18
|
|
19
19
|
if path
|
20
|
-
return HostsFile.load(path).map(&:name).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
20
|
+
return HostsFile.load(path).map(&:name).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
|
21
21
|
end
|
22
22
|
|
23
|
-
[]
|
23
|
+
[]
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-sniper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.pre8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brody Hoskins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: down
|