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: fdb713f65960730a1ac99906c65aeb79b30b69514eedab948ee20eb27bf30920
4
- data.tar.gz: 28d04385a9759e9bada850e6c4dde26d7f3d983ddedd9d5782d31c6001cab19d
3
+ metadata.gz: 512e7b14734237f57edc560759f751a748083c2639fa4adc5beac81f460222f5
4
+ data.tar.gz: f1223fae9ec10a2b42c797dd43a1a874ac916f241272cb84526994994c82d621
5
5
  SHA512:
6
- metadata.gz: c02d1bb299780f04041d8899aeb72b7457ec8954184c95a0bae61731c1b36763f44055b41d4e8115c42bf0ccfdb68b407db3aef5ff71a3dc0e01d8dde0bcee99
7
- data.tar.gz: fd3f08b34762d39e3610ad23810736a667e83f7b77459d8508e625f67007b0fa7adcd028091c65c4f05e28f39eacc6d805313e6733c9d8592f4657b5ade50e2b
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.pre7'
7
- spec.date = '2021-07-26'
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 [].to_set unless File.exist?(path)
12
+ return [] unless File.exist?(path)
13
13
 
14
14
  yaml = YAML.safe_load(File.read(path), permitted_classes: [Symbol])
15
- return [].to_set unless yaml.dig(:sources)&.dig(list.to_sym)
15
+ return [] unless yaml.dig(:sources)&.dig(list.to_sym)
16
16
 
17
- hostnames = [].to_set
17
+ hostnames = []
18
18
  yaml.dig(:sources).dig(list.to_sym).each do |source|
19
- return [].to_set unless source.dig(:importer)
20
- return [].to_set unless source.dig(:uri)
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 [].to_set unless File.exist?(path)
6
+ return [] unless File.exist?(path)
7
7
 
8
- File.open(path).readlines(chomp: true).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }.to_set
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) }.to_set
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
- [].to_set
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 [].to_set unless File.exist?(path)
6
+ return [] unless File.exist?(path)
7
7
 
8
- HostsFile.load(path).map(&:name).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }.to_set
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) }.to_set
20
+ return HostsFile.load(path).map(&:name).map { |hostname| clean(hostname) }.reject { |hostname| rejector(hostname) }
21
21
  end
22
22
 
23
- [].to_set
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.pre7
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-07-26 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: down