emailist 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/emailist/version.rb +1 -1
- data/lib/emailist.rb +10 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea9eab6bff1e9e25048b41d223021e6cb26365e7
|
4
|
+
data.tar.gz: 6012cf99e4fb5e8454da3828c5690618a9cc73aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2152ad37f6adfae9608551af94e6825f88d762b6092bd1086a01e8b7c9ba7d62c78bdfdd3c2a0bdd6832aa245da0ef1f9094033575d43f861fe28823dd6454a4
|
7
|
+
data.tar.gz: 2ded1d96588586da8d0340de69c293ff9838e7c94f03118ac1320187e28b7617146e6b83f675e1c18a9855ba4c99710877cce867ddb9d0171f7f217157af95eb
|
data/lib/emailist/version.rb
CHANGED
data/lib/emailist.rb
CHANGED
@@ -154,26 +154,27 @@ private
|
|
154
154
|
return true if live_hosts.include?(domain)
|
155
155
|
return false if dead_hosts.include?(domain)
|
156
156
|
|
157
|
+
result = false # assume the host is dead
|
158
|
+
|
157
159
|
resolv = Resolv::DNS.new(
|
158
160
|
nameserver: ['8.8.8.8'],
|
159
161
|
search: [],
|
160
162
|
ndots: 1
|
161
163
|
)
|
162
164
|
ip_addr = begin
|
163
|
-
resolv.getaddress(domain)
|
165
|
+
resolv.getaddress(domain).to_s
|
164
166
|
rescue Resolv::ResolvError
|
165
167
|
end
|
166
168
|
dns_result = ip_addr ? true : false
|
167
169
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
170
|
+
if dns_result
|
171
|
+
ping_result = Net::Ping::External.new(ip_addr).ping
|
172
|
+
|
173
|
+
if ping_result
|
174
|
+
result = true
|
175
|
+
end
|
176
|
+
end
|
175
177
|
|
176
|
-
result = (dns_result || ping_result)
|
177
178
|
if result
|
178
179
|
live_hosts.push(domain)
|
179
180
|
live_hosts.uniq!
|