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 +4 -4
- data/dns-sniper.gemspec +1 -1
- data/lib/dns-sniper/hostnames.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d15d70b6571fb7db1cd3b4e53c4eac7a6041c0d08072c47309d8202dc5569d3
|
4
|
+
data.tar.gz: 5dadb99daabfd7896735c94ac8981a70df077f73daa3f52f4bbc50570c6efd32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eac165aa45a6056690e69f2a5ebe939996a8b7364d0ebecd953827c8d3c20f112e9e8fd4cf42421d16771d0084fdb23c12e52dddba50911dbd9d8e61f8797e7
|
7
|
+
data.tar.gz: 6e6a4e723a92e90ce128e893172395fc3f66333aac3e9d0eda03c7f2f98fbb8f5d559cde4c25540b78b476c032e9e78af698cfc52e156b5dbabbbf5ba5697a3e
|
data/dns-sniper.gemspec
CHANGED
data/lib/dns-sniper/hostnames.rb
CHANGED
@@ -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
|
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?('.') && (
|
142
|
+
elsif line.include?('.') && !URI.parse(line).is_a?(URI::HTTP)
|
142
143
|
return 'hostnames'
|
143
144
|
end
|
144
145
|
end
|