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
commita22b8e96ead33b0f97ed5243dbad7f7b6cd5135d (patch)
tree3fe30365cc9d793c752653a59614b52009ef9336 /lib/custodian/protocoltest/smtprelay.rb
parent7782df6020704f51ee2d6194d8d3b74f28a53401 (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