summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:14:15 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:14:15 +0000
commit82171c3406a790ac9740c439e2aafce21853e0a0 (patch)
tree71139d061c87fbde7aefc12d9364339df6d228b8 /lib
parent1383d0f44f8ce524c297714bd288f95a548107ed (diff)
Avoid redudent returns.
The last expression of a method is the return value. So: def foo; false ; end Is the same as: def foo; return false; end
Diffstat (limited to 'lib')
-rw-r--r--lib/custodian/protocoltest/dns.rb2
-rw-r--r--lib/custodian/protocoltest/dnsbl.rb2
-rw-r--r--lib/custodian/protocoltest/http.rb2
-rw-r--r--lib/custodian/protocoltest/ldap.rb2
-rw-r--r--lib/custodian/protocoltest/ping.rb2
-rw-r--r--lib/custodian/protocoltest/ssl.rb6
-rw-r--r--lib/custodian/protocoltest/tcp.rb6
-rw-r--r--lib/custodian/util/ping.rb2
-rw-r--r--lib/custodian/worker.rb2
9 files changed, 13 insertions, 13 deletions
diff --git a/lib/custodian/protocoltest/dns.rb b/lib/custodian/protocoltest/dns.rb
index 4bdbd83..c544b38 100644
--- a/lib/custodian/protocoltest/dns.rb
+++ b/lib/custodian/protocoltest/dns.rb
@@ -118,7 +118,7 @@ module Custodian
@error = "DNS server *#{@host}* (#{@server_ip}) returned the wrong records for @#{resolve_name} IN #{resolve_type}@.\n\nWe expected '#{resolve_expected.join(",")}', but we received '#{results.join(",")}'\n"
end
- return @error.nil?
+ @error.nil?
end
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb
index da93ff0..50a3b7b 100644
--- a/lib/custodian/protocoltest/dnsbl.rb
+++ b/lib/custodian/protocoltest/dnsbl.rb
@@ -98,7 +98,7 @@ module Custodian
end
end
- return false
+ false
end
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index 9226441..665e789 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -331,7 +331,7 @@ module Custodian
#
# All done.
#
- return true
+ true
end
#
diff --git a/lib/custodian/protocoltest/ldap.rb b/lib/custodian/protocoltest/ldap.rb
index ba8b442..aee09e0 100644
--- a/lib/custodian/protocoltest/ldap.rb
+++ b/lib/custodian/protocoltest/ldap.rb
@@ -133,7 +133,7 @@ module Custodian
end
@error = "LDAP server test failed against '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'"
- return false
+ false
end
diff --git a/lib/custodian/protocoltest/ping.rb b/lib/custodian/protocoltest/ping.rb
index 90e4241..5a9bf0a 100644
--- a/lib/custodian/protocoltest/ping.rb
+++ b/lib/custodian/protocoltest/ping.rb
@@ -184,7 +184,7 @@ module Custodian
# So by the time we reach here we know that all the addresses
# were pingable.
#
- return true
+ true
end
diff --git a/lib/custodian/protocoltest/ssl.rb b/lib/custodian/protocoltest/ssl.rb
index 67af348..9f65712 100644
--- a/lib/custodian/protocoltest/ssl.rb
+++ b/lib/custodian/protocoltest/ssl.rb
@@ -19,7 +19,7 @@ class SSLCheck
# This is a helper for console-debugging.
def verbose( msg )
- return(msg)
+ (msg)
end
#
@@ -186,7 +186,7 @@ class SSLCheck
s.close if s.respond_to?(:close) and !s.closed?
end
- return @certificate
+ @certificate
end
#
@@ -232,7 +232,7 @@ class SSLCheck
s.close if s.respond_to?(:close) and !s.closed?
end
- return false
+ false
end
def verify_subject
diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb
index dfaab2d..60c7be7 100644
--- a/lib/custodian/protocoltest/tcp.rb
+++ b/lib/custodian/protocoltest/tcp.rb
@@ -126,7 +126,7 @@ module Custodian
# reset the error, in case we were previously executed.
@error = nil
- return( run_test_internal( @host, @port, @banner, ( ! @banner.nil? ) ) )
+ ( run_test_internal( @host, @port, @banner, ( ! @banner.nil? ) ) )
end
@@ -246,7 +246,7 @@ module Custodian
# All was OK
#
@error = nil
- return true
+ true
end
@@ -318,7 +318,7 @@ module Custodian
return false
end
@error = "Misc failure"
- return false
+ false
end
diff --git a/lib/custodian/util/ping.rb b/lib/custodian/util/ping.rb
index 4056803..771cfd6 100644
--- a/lib/custodian/util/ping.rb
+++ b/lib/custodian/util/ping.rb
@@ -85,7 +85,7 @@ module Custodian
else
puts "ERROR: Resolved to neither an IPv6 or IPv4 address."
end
- return false
+ false
end
end
diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb
index 2c806fd..9f66e4a 100644
--- a/lib/custodian/worker.rb
+++ b/lib/custodian/worker.rb
@@ -232,7 +232,7 @@ module Custodian
end
- return result
+ result
end