dns-sniper 0.0.1.pre3 → 0.0.1.pre4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb0e330d2e7c2b4061f4c93ff5825ff09d768a55f57e732e6557f13e822c9436
4
- data.tar.gz: 6909002d1f80141a9855b917be54c0e2076c0b465f2f8aa6cf143ea93f6eba8d
3
+ metadata.gz: 0d15d70b6571fb7db1cd3b4e53c4eac7a6041c0d08072c47309d8202dc5569d3
4
+ data.tar.gz: 5dadb99daabfd7896735c94ac8981a70df077f73daa3f52f4bbc50570c6efd32
5
5
  SHA512:
6
- metadata.gz: bbb70cdbbf01ade47a2d6b359fe63fb97e1c577795d979746d93c858b0644313e0285415acf86a79d56a6baaaa6c0cc1b908bc01fb90b8b90d6bb86df2219125
7
- data.tar.gz: f5773fc187a174a969c4c8953ab3c24e9803a3eba481fb028f300a9886aa09391d85a9f5383c46a726d123b954489f4e6e5a1a613b6300f4cdbdae3ddb353bc2
6
+ metadata.gz: 4eac165aa45a6056690e69f2a5ebe939996a8b7364d0ebecd953827c8d3c20f112e9e8fd4cf42421d16771d0084fdb23c12e52dddba50911dbd9d8e61f8797e7
7
+ data.tar.gz: 6e6a4e723a92e90ce128e893172395fc3f66333aac3e9d0eda03c7f2f98fbb8f5d559cde4c25540b78b476c032e9e78af698cfc52e156b5dbabbbf5ba5697a3e
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'dns-sniper'
5
5
  spec.license = 'MIT'
6
- spec.version = '0.0.1.pre3'
6
+ spec.version = '0.0.1.pre4'
7
7
  spec.date = '2020-11-01'
8
8
 
9
9
  spec.authors = ['Brody Hoskins']
@@ -24,15 +24,17 @@ module DNSSniper
24
24
  paths_or_urls = [paths_or_urls] if paths_or_urls.class == String
25
25
 
26
26
  paths_or_urls.each do |path_or_url|
27
- path_or_url = path_or_url.strip
27
+ path_or_url.chomp!
28
28
 
29
29
  if File.exist?(path_or_url)
30
- contents = File.open(path_or_url).readlines
30
+ contents = File.open(path_or_url).readlines(chomp: true)
31
31
  else
32
32
  begin
33
33
  down = Down.download(path_or_url)
34
34
  path_or_url = down.path
35
- contents = down.readlines
35
+ contents = down.readlines(chomp: true)
36
+ rescue Down::InvalidUrl
37
+ warn "\"#{path_or_url}\" does not exist, nor is it a valid URL"
36
38
  rescue Down::NotFound
37
39
  warn "\"#{path_or_url}\" does not exist"
38
40
  return self
@@ -135,10 +137,9 @@ module DNSSniper
135
137
  next if line.include?('#')
136
138
 
137
139
  line = line.downcase
138
-
139
140
  if line.strip.split(/\s/).first =~ Regexp.union([Resolv::IPv4::Regex, Resolv::IPv6::Regex])
140
141
  return 'hosts'
141
- elsif line.include?('.') && (!line.include? 'http') && path_or_url.end_with?('.list')
142
+ elsif line.include?('.') && !URI.parse(line).is_a?(URI::HTTP)
142
143
  return 'hostnames'
143
144
  end
144
145
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns-sniper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre3
4
+ version: 0.0.1.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brody Hoskins