summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/dnsbl.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:10:32 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:10:32 +0000
commit1ce0906b3480702085d4596dbb4758c115ab298f (patch)
tree695cd365c2ff73904328a049f3b9cfcc5a0a1abd /lib/custodian/protocoltest/dnsbl.rb
parent891b720013f06f092f6be82adad95e5551c696b6 (diff)
Don't use parenthesis aroudn conditions in an if.
Diffstat (limited to 'lib/custodian/protocoltest/dnsbl.rb')
-rw-r--r--lib/custodian/protocoltest/dnsbl.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb
index 7f96768..da93ff0 100644
--- a/lib/custodian/protocoltest/dnsbl.rb
+++ b/lib/custodian/protocoltest/dnsbl.rb
@@ -36,7 +36,7 @@ module Custodian
#
# See which blacklist(s) we're testing against.
#
- if ( line =~ /via\s+([^\s]+)\s+/ )
+ if line =~ /via\s+([^\s]+)\s+/
@zones = $1.dup
else
@zones = "zen.spamhaus.org"
@@ -45,7 +45,7 @@ module Custodian
#
# Is this test inverted?
#
- if ( line =~ /must\s+not\s+run\s+/ )
+ if line =~ /must\s+not\s+run\s+/
@inverted = true
else
@inverted = false
@@ -81,13 +81,13 @@ module Custodian
# Given IP 1.2.3.4 we lookup the address of the name
# 4.3.2.1.$zone
#
- if ( @host =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/ )
+ if @host =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/
name = "#{$4}.#{$3}.#{$2}.#{$1}.#{zone}"
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