Class: Net::Dns::Rbl::Netcheck
- Inherits:
-
Object
- Object
- Net::Dns::Rbl::Netcheck
- Defined in:
- lib/net-dns-rbl/netcheck.rb
Instance Method Summary collapse
-
#addToLists(list) ⇒ Object
Add additional dnsbl lookup lists.
-
#initialize(ip) ⇒ Netcheck
constructor
A new instance of Netcheck.
- #performLookups ⇒ Object
-
#removeFromLists(list) ⇒ Object
Remove an existing dnsbl list from the existing hash.
- #showCurrentLists ⇒ Object
Constructor Details
Instance Method Details
#addToLists(list) ⇒ Object
Add additional dnsbl lookup lists
16 17 18 |
# File 'lib/net-dns-rbl/netcheck.rb', line 16 def addToLists(list) @lists.push(list) end |
#performLookups ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/net-dns-rbl/netcheck.rb', line 29 def performLookups @lists.each do |l| begin host = @reverseip+'.'+l resip = Resolv::getaddress(host) if resip.match(/(127)\.\d{1}\.\d{1,3}\.\d{1,3}/) @listed << l end rescue Exception => e case e when Resolv::ResolvError nil when Interrupt puts "\nCaught signal SIGINT. Exiting..." exit 1 else puts ": \e[0;47mTIMEOUT\e[0m\n" end end end return @listed end |
#removeFromLists(list) ⇒ Object
Remove an existing dnsbl list from the existing hash
21 22 23 |
# File 'lib/net-dns-rbl/netcheck.rb', line 21 def removeFromLists(list) @lists.delete(list) end |
#showCurrentLists ⇒ Object
25 26 27 |
# File 'lib/net-dns-rbl/netcheck.rb', line 25 def showCurrentLists @lists end |