summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 12:52:08 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 12:52:08 +0000
commitb4340b00e2c7a6e85448787d4dee41d7202859f2 (patch)
treedb469a840e4c8bb2ef4f896a67eb62a8459e5dc4 /lib/custodian
parent664ff3648246f38a4c49adc32e1ce0887dcbfe37 (diff)
Avoid redundent ".to_s" methods.
These are not required if the argument is string already, or has a _to_s method which will be automatically invoked by magic.
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/protocoltest/http.rb2
-rw-r--r--lib/custodian/protocoltest/ssl.rb8
-rw-r--r--lib/custodian/worker.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index cc171a6..0d20dfb 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -297,7 +297,7 @@ module Custodian
# Nothing to see here..!
resolution_errors << resolve_mode
rescue => x
- errors << "#{protocol_msg}: #{x.class.to_s}: #{x.message}\n #{x.backtrace.join("\n ")}."
+ errors << "#{protocol_msg}: #{x.class}: #{x.message}\n #{x.backtrace.join("\n ")}."
end
#
diff --git a/lib/custodian/protocoltest/ssl.rb b/lib/custodian/protocoltest/ssl.rb
index ab57dff..18da9f1 100644
--- a/lib/custodian/protocoltest/ssl.rb
+++ b/lib/custodian/protocoltest/ssl.rb
@@ -178,10 +178,10 @@ class SSLCheck
ctx = OpenSSL::SSL::SSLContext.new(:SSLv3_client)
retry
end
- self.errors << verbose("*Caught #{err.class}* (#{err.to_s}) when connecting to #{uri.host}:#{uri.port}")
+ self.errors << verbose("*Caught #{err.class}* (#{err}) when connecting to #{uri.host}:#{uri.port}")
rescue StandardError, Timeout::Error => err
- self.errors << verbose("*Caught #{err.class}* (#{err.to_s}) when connecting to #{uri.host}:#{uri.port}")
+ self.errors << verbose("*Caught #{err.class}* (#{err}) when connecting to #{uri.host}:#{uri.port}")
ensure
s.close if s.respond_to?(:close) and !s.closed?
end
@@ -227,7 +227,7 @@ class SSLCheck
#
return true
rescue StandardError, Timeout::Error => err
- self.errors << verbose("*Caught #{err.class}* (#{err.to_s}) when connecting to #{uri.host}:#{uri.port} using SSLv3")
+ self.errors << verbose("*Caught #{err.class}* (#{err}) when connecting to #{uri.host}:#{uri.port} using SSLv3")
ensure
s.close if s.respond_to?(:close) and !s.closed?
end
@@ -313,7 +313,7 @@ class SSLCheck
# including any bundle that has been uploaded.
#
elsif self.certificate_store.is_a?(OpenSSL::X509::Store) and self.certificate_store.verify(self.certificate)
- verbose "Certificate signed by #{self.certificate.issuer.to_s}"
+ verbose "Certificate signed by #{self.certificate.issuer}"
return true
#
diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb
index df9e117..b411c00 100644
--- a/lib/custodian/worker.rb
+++ b/lib/custodian/worker.rb
@@ -148,7 +148,7 @@ module Custodian
begin
- log_message( "Acquired job: #{test.to_s}" )
+ log_message( "Acquired job: #{test}" )
#
# The count of times this test has run, the result, and the start-time