summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/smtprelay.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/smtprelay.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/smtprelay.rb')
-rw-r--r--lib/custodian/protocoltest/smtprelay.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/custodian/protocoltest/smtprelay.rb b/lib/custodian/protocoltest/smtprelay.rb
index 397c5cb..ef07f82 100644
--- a/lib/custodian/protocoltest/smtprelay.rb
+++ b/lib/custodian/protocoltest/smtprelay.rb
@@ -61,10 +61,10 @@ module Custodian
# Read the hostname for usage in the SMTP-transaction.
#
def get_hostname
- hostname = "localhost.localdomain"
+ hostname = 'localhost.localdomain'
- if File.exist?( "/etc/hostname" )
- File.readlines("/etc/hostname" ).each do |line|
+ if File.exist?( '/etc/hostname' )
+ File.readlines('/etc/hostname' ).each do |line|
hostname = line if !line.nil?
hostname.chomp!
end
@@ -87,10 +87,10 @@ module Custodian
begin
Net::SMTP.start(@host,@port, get_hostname ) do |smtp|
- sent = smtp.send_message message, "noreply@bytemark.co.uk", "noreply@bytemark.co.uk"
+ sent = smtp.send_message message, 'noreply@bytemark.co.uk', 'noreply@bytemark.co.uk'
@status = sent.status.to_s
- if @status === "250"
+ if @status === '250'
@error = "NOT OK: message sent on #{@host} with status #{@status}"
else
@error = "OK: message not sent on #{@host} with status #{@status}"
@@ -101,10 +101,10 @@ module Custodian
# and whether or not we're inverting the test. (eg, 'must not')
#
- return @inverted if @status == "250" and @inverted
- return !@inverted if @status == "250" and !@inverted
- return @inverted if @status != "250" and !@inverted
- return !@inverted if @status != "250" and @inverted
+ return @inverted if @status == '250' and @inverted
+ return !@inverted if @status == '250' and !@inverted
+ return @inverted if @status != '250' and !@inverted
+ return !@inverted if @status != '250' and @inverted
end # Net SMTP
@@ -128,7 +128,7 @@ module Custodian
end
# register ourselves with the class-factory
- register_test_type "smtprelay"
+ register_test_type 'smtprelay'
end
end
end