summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/ssl.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:19:15 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:19:15 +0000
commitaf2ee063abea8235a8cbd1448533e4f4fbc0d0af (patch)
tree969e448e2d5995f7e838a68ef1d25d54df9b8d29 /lib/custodian/protocoltest/ssl.rb
parentbb2ec1f07af747c69f2fd1e5b70c41b35fb069e6 (diff)
Prefer single-quotes when you don't need interpolation.
So "foo" is less good than 'foo'.
Diffstat (limited to 'lib/custodian/protocoltest/ssl.rb')
-rw-r--r--lib/custodian/protocoltest/ssl.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/custodian/protocoltest/ssl.rb b/lib/custodian/protocoltest/ssl.rb
index 86acb34..39a962d 100644
--- a/lib/custodian/protocoltest/ssl.rb
+++ b/lib/custodian/protocoltest/ssl.rb
@@ -26,7 +26,7 @@ class SSLCheck
# Takes one parameter -- the URL.
#
def initialize(uri)
- raise ArgumentError, "URI must be a string" unless uri.is_a?(String)
+ raise ArgumentError, 'URI must be a string' unless uri.is_a?(String)
@uri = URI.parse(uri)
@domain = @uri.host
@@ -60,7 +60,7 @@ class SSLCheck
# Allows the domain to be set manually.
#
def domain=(d)
- raise ArgumentError, "domain must be a String" unless d.is_a?(String)
+ raise ArgumentError, 'domain must be a String' unless d.is_a?(String)
@domain=d
end
@@ -76,7 +76,7 @@ class SSLCheck
# ones from ALL_TESTS are taken. Anything else is ignored.
#
def tests=(ts)
- raise ArgumentError, "tests must be an Array" unless ts.is_a?(Array)
+ raise ArgumentError, 'tests must be an Array' unless ts.is_a?(Array)
@tests = ts.collect{|t| t.to_sym}.select{|t| ALL_TESTS.include?(t)}
@tests
@@ -94,7 +94,7 @@ class SSLCheck
# Probably not much use here.
#
def key=(k)
- raise ArgumentError, "key must be a String" unless k.is_a?(String)
+ raise ArgumentError, 'key must be a String' unless k.is_a?(String)
if k =~ /-----BEGIN/
@key = OpenSSL::PKey::RSA.new(k)
else
@@ -127,7 +127,7 @@ class SSLCheck
elsif b.is_a?(OpenSSL::X509::Certificate)
self.certificate_store.add_cert(b)
else
- raise ArgumentError, "bundle must be a String, an Array, or an OpenSSL::X509::Certificate"
+ raise ArgumentError, 'bundle must be a String, an Array, or an OpenSSL::X509::Certificate'
end
b
end
@@ -140,7 +140,7 @@ class SSLCheck
@certificate_store = OpenSSL::X509::Store.new
@certificate_store.set_default_paths
- @certificate_store.add_path("/etc/ssl/certs")
+ @certificate_store.add_path('/etc/ssl/certs')
@certificate_store
end
@@ -412,7 +412,7 @@ module Custodian
# Double-check we've got an SSL host
#
if ! @host =~ /^https:\/\//
- puts( "Not an SSL URL" )
+ puts( 'Not an SSL URL' )
return true
end
@@ -442,7 +442,7 @@ module Custodian
@error
end
- register_test_type "https"
+ register_test_type 'https'
end
end