diff options
author | Steve Kemp <steve@steve.org.uk> | 2016-04-22 21:42:32 +0300 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2016-04-22 21:42:32 +0300 |
commit | 12de7cf1aefcd5d567a9e6e2eaa061f2074c8dbb (patch) | |
tree | 5912d325d739d66a05690cb0d4b87a92ffde3fca /lib/custodian/protocoltest/dnsbl.rb | |
parent | 91bfb015647bba1249a96933a48d88f2a50039a9 (diff) |
More updates to silence rubocop style-guides.
These warnings were largely whitespace-based.
Diffstat (limited to 'lib/custodian/protocoltest/dnsbl.rb')
-rw-r--r-- | lib/custodian/protocoltest/dnsbl.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb index 0e1459d..37dbd74 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' @@ -63,7 +63,7 @@ module Custodian def run_test # The error is empty. - @error = nil + @error = nil @zones.split(',').each do |zone| @@ -73,13 +73,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.empty?) @error = "IP #{@host} listed in blacklist #{zone}. Lookup of #{name} lead to result: #{result}" return Custodian::TestResult::TEST_PASSED end |