summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/dnsbl.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:19:47 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:19:47 +0000
commite716a49dabe2c086a97e2d8b3cffe5cf369ad026 (patch)
treee7e98125f89941db4c9d0f48f2df9c410467a3d8 /lib/custodian/protocoltest/dnsbl.rb
parentaf2ee063abea8235a8cbd1448533e4f4fbc0d0af (diff)
Removed spaces inside parenthesis.
Diffstat (limited to 'lib/custodian/protocoltest/dnsbl.rb')
-rw-r--r--lib/custodian/protocoltest/dnsbl.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb
index d307470..6d55260 100644
--- a/lib/custodian/protocoltest/dnsbl.rb
+++ b/lib/custodian/protocoltest/dnsbl.rb
@@ -24,14 +24,14 @@ module Custodian
#
# Save away state from the configuration line.
#
- def initialize( line )
+ def initialize(line)
@line = line
- @host = line.split( /\s+/)[0]
+ @host = line.split(/\s+/)[0]
#
# Ensure the host is an IP address.
#
- raise ArgumentError, 'The target must be an IP address' unless( @host =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/ )
+ raise ArgumentError, 'The target must be an IP address' unless(@host =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/)
#
# See which blacklist(s) we're testing against.
@@ -73,7 +73,7 @@ module Custodian
# The error is empty.
@error = nil
- @zones.split( ',' ).each do |zone|
+ @zones.split(',').each do |zone|
#
# Convert the IP to be looked up.
@@ -85,9 +85,9 @@ module Custodian
name = "#{$4}.#{$3}.#{$2}.#{$1}.#{zone}"
- result = Custodian::Util::DNS.hostname_to_ip( name )
+ result = Custodian::Util::DNS.hostname_to_ip(name)
- if ( !result.nil? ) && ( result.length > 0 )
+ if (!result.nil?) && (result.length > 0)
@error = "IP #{@host} listed in blacklist #{zone}. Lookup of #{name} lead to result: #{result}"
return true
end