summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:21:36 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:21:36 +0000
commit0c2d64d6daf9a9a901a3b67730680e3e97c60f8d (patch)
tree623a1932c32dcf6cbac9254334690db82ac3816e /lib/custodian/protocoltest
parent6d95fd2e13f23037bbae89b5627caf53aa346e73 (diff)
Whitespace fixups.
These were all identified and suggested by rubocop.
Diffstat (limited to 'lib/custodian/protocoltest')
-rw-r--r--lib/custodian/protocoltest/dns.rb10
-rw-r--r--lib/custodian/protocoltest/dnsbl.rb2
-rw-r--r--lib/custodian/protocoltest/http.rb2
-rw-r--r--lib/custodian/protocoltest/mx.rb6
-rw-r--r--lib/custodian/protocoltest/ssl.rb4
-rw-r--r--lib/custodian/protocoltest/tcp.rb4
6 files changed, 14 insertions, 14 deletions
diff --git a/lib/custodian/protocoltest/dns.rb b/lib/custodian/protocoltest/dns.rb
index add4a87..c65f90a 100644
--- a/lib/custodian/protocoltest/dns.rb
+++ b/lib/custodian/protocoltest/dns.rb
@@ -64,10 +64,10 @@ module Custodian
#
# Ensure we had all the data.
#
- raise ArgumentError, 'Missing host to resolve' unless(@resolve_name)
- raise ArgumentError, 'Missing type of record to lookup' unless(@resolve_type)
- raise ArgumentError, 'Missing expected results' unless(@resolve_expected)
- raise ArgumentError, "Uknown record type: #{@resolve_type}" unless(@resolve_type =~ /^(A|NS|MX|AAAA)$/)
+ raise ArgumentError, 'Missing host to resolve' unless @resolve_name
+ raise ArgumentError, 'Missing type of record to lookup' unless @resolve_type
+ raise ArgumentError, 'Missing expected results' unless @resolve_expected
+ raise ArgumentError, "Uknown record type: #{@resolve_type}" unless @resolve_type =~ /^(A|NS|MX|AAAA)$/
#
# The host to query against
@@ -143,7 +143,7 @@ module Custodian
return nil
end
- Resolv::DNS.open(:nameserver=>[@server_ip]) do |dns|
+ Resolv::DNS.open(:nameserver => [@server_ip]) do |dns|
case ltype
when /^A$/ then
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb
index 6d55260..2e51c5d 100644
--- a/lib/custodian/protocoltest/dnsbl.rb
+++ b/lib/custodian/protocoltest/dnsbl.rb
@@ -31,7 +31,7 @@ module Custodian
#
# 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.
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index 7bbc3e2..591abfb 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -223,7 +223,7 @@ module Custodian
#
if @cache_busting
u = URI.parse(test_url)
- if ! u.query
+ if !u.query
u.query = "ctime=#{Time.now.to_i}"
test_url = u.to_s
end
diff --git a/lib/custodian/protocoltest/mx.rb b/lib/custodian/protocoltest/mx.rb
index a9cac62..c323af7 100644
--- a/lib/custodian/protocoltest/mx.rb
+++ b/lib/custodian/protocoltest/mx.rb
@@ -114,7 +114,7 @@ module Custodian
read = socket.sysread(1024)
# trim to a sane length & strip newlines.
- if ! read.nil?
+ if !read.nil?
read = read[0,255]
read.gsub!(/[\n\r]/, '')
end
@@ -126,13 +126,13 @@ module Custodian
end
rescue
# Failure to connect.
- failed +=1
+ failed += 1
error += "Error connecting to #{backend}:25. "
end
end
rescue Timeout::Error => ex
# Timeout
- failed +=1
+ failed += 1
error += "Timeout connecting to #{backend}:25. "
end
end
diff --git a/lib/custodian/protocoltest/ssl.rb b/lib/custodian/protocoltest/ssl.rb
index dc62a77..e34e770 100644
--- a/lib/custodian/protocoltest/ssl.rb
+++ b/lib/custodian/protocoltest/ssl.rb
@@ -61,7 +61,7 @@ class SSLCheck
#
def domain=(d)
raise ArgumentError, 'domain must be a String' unless d.is_a?(String)
- @domain=d
+ @domain = d
end
#
@@ -277,7 +277,7 @@ class SSLCheck
return true
end
- days_until_expiry = (self.certificate.not_after.to_i - Time.now.to_i)/(24.0*3600).floor.to_i
+ days_until_expiry = (self.certificate.not_after.to_i - Time.now.to_i) / (24.0 * 3600).floor.to_i
if days_until_expiry > 14
verbose "The certificate for #{self.domain} is valid until #{self.certificate.not_after}."
diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb
index 0f7e2b5..eb00e99 100644
--- a/lib/custodian/protocoltest/tcp.rb
+++ b/lib/custodian/protocoltest/tcp.rb
@@ -232,7 +232,7 @@ module Custodian
# were given.
#
ips.each do |ip|
- if ! run_test_internal_real(ip, port, banner, do_read)
+ if !run_test_internal_real(ip, port, banner, do_read)
return false
#
@@ -278,7 +278,7 @@ module Custodian
read = socket.sysread(1024) if do_read
# trim to a sane length & strip newlines.
- if ! read.nil?
+ if !read.nil?
read = read[0,255]
read.gsub!(/[\n\r]/, '')
end