summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:15:06 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:15:06 +0000
commit48e66ecec133ef348c0a46b80998230116121f3b (patch)
tree98484eb8680894990229e77e9f3004fed6836017
parent82171c3406a790ac9740c439e2aafce21853e0a0 (diff)
Do not terminate expressions with ";".
Ruby is not Perl, much as I sometimes wish it were.
-rw-r--r--lib/custodian/alerts/graphite.rb2
-rw-r--r--lib/custodian/alerts/smtp.rb4
-rw-r--r--lib/custodian/protocoltest/mx.rb2
-rw-r--r--lib/custodian/protocoltest/ssl.rb2
-rw-r--r--lib/custodian/util/timespan.rb2
-rwxr-xr-xt/test-custodian-parser.rb16
-rwxr-xr-xt/test-custodian-util-ping.rb4
7 files changed, 16 insertions, 16 deletions
diff --git a/lib/custodian/alerts/graphite.rb b/lib/custodian/alerts/graphite.rb
index 2e49125..778b36b 100644
--- a/lib/custodian/alerts/graphite.rb
+++ b/lib/custodian/alerts/graphite.rb
@@ -64,7 +64,7 @@ module Custodian
# Send via UDP.
#
socket = UDPSocket.new
- socket.send( payload, 0, @target, 2003 );
+ socket.send( payload, 0, @target, 2003 )
socket.close
end
diff --git a/lib/custodian/alerts/smtp.rb b/lib/custodian/alerts/smtp.rb
index d37701b..e418031 100644
--- a/lib/custodian/alerts/smtp.rb
+++ b/lib/custodian/alerts/smtp.rb
@@ -31,7 +31,7 @@ module Custodian
#
def raise
subject = "#{test.target} alert #{test.get_type}-test - #{test.error}"
- body = "The alert has raised, with the following details:\n#{test.error}\nRegards\n";
+ body = "The alert has raised, with the following details:\n#{test.error}\nRegards\n"
_send_mail( @target, subject, body )
end
@@ -43,7 +43,7 @@ module Custodian
#
def clear
subject = "#{test.target} cleared #{test.get_type}-test"
- body = "The alert has cleared\nRegards\n";
+ body = "The alert has cleared\nRegards\n"
_send_mail( @target, subject, body )
end
diff --git a/lib/custodian/protocoltest/mx.rb b/lib/custodian/protocoltest/mx.rb
index b77e596..0df1b5d 100644
--- a/lib/custodian/protocoltest/mx.rb
+++ b/lib/custodian/protocoltest/mx.rb
@@ -144,7 +144,7 @@ module Custodian
@error = "There are #{mx.size} hosts running as MX-servers for domain #{@host} - #{passed}:OK #{failed}:FAILED - #{error}"
return false
else
- return true;
+ return true
end
end
diff --git a/lib/custodian/protocoltest/ssl.rb b/lib/custodian/protocoltest/ssl.rb
index 9f65712..86acb34 100644
--- a/lib/custodian/protocoltest/ssl.rb
+++ b/lib/custodian/protocoltest/ssl.rb
@@ -427,7 +427,7 @@ module Custodian
return true
else
puts( "SSL Verification for #{@host} has failed." )
- @error = "SSL Verification for #{@host} failed: ";
+ @error = "SSL Verification for #{@host} failed: "
@error += s.errors.join("\n")
return false
end
diff --git a/lib/custodian/util/timespan.rb b/lib/custodian/util/timespan.rb
index b3cb647..36e8d9e 100644
--- a/lib/custodian/util/timespan.rb
+++ b/lib/custodian/util/timespan.rb
@@ -19,7 +19,7 @@ module Custodian
#
if ( desc.kind_of? String ) &&
( desc =~ /([0-9]+)pm$/i )
- desc = $1.dup.to_i + 12;
+ desc = $1.dup.to_i + 12
end
#
diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb
index bd5205b..49416b3 100755
--- a/t/test-custodian-parser.rb
+++ b/t/test-custodian-parser.rb
@@ -82,7 +82,7 @@ class TestCustodianParser < Test::Unit::TestCase
# 1.c. Adding a test will return an array of test-objects.
- result = parser.parse_line( "smtp.bytemark.co.uk must run smtp on 25 otherwise 'failure'." );
+ result = parser.parse_line( "smtp.bytemark.co.uk must run smtp on 25 otherwise 'failure'." )
assert( !result.nil? )
assert( result.kind_of? Array )
assert( result.size == 1 )
@@ -99,9 +99,9 @@ class TestCustodianParser < Test::Unit::TestCase
# 2.b. Adding a test will return an array of test-objects.
tmp = []
- tmp.push( "smtp.bytemark.co.uk must run ssh on 22 otherwise 'oops'." );
+ tmp.push( "smtp.bytemark.co.uk must run ssh on 22 otherwise 'oops'." )
ret = parser.parse_lines( tmp )
- assert( ret.kind_of? Array );
+ assert( ret.kind_of? Array )
assert( ret.size == 1 )
#
@@ -121,7 +121,7 @@ smtp.bytemark.co.uk must run smtp on 25.
google.com must run ping otherwise 'internet broken?'.
EOF
ret = parser.parse_lines( str )
- assert( ret.kind_of? Array );
+ assert( ret.kind_of? Array )
assert( ret.size == 1 )
end
@@ -172,8 +172,8 @@ EOF
# Input text
#
text = []
- text.push( "FOO is kvm1.vm.bytemark.co.uk." );
- text.push( "FOO2 is kvm2.vm.bytemark.co.uk." );
+ text.push( "FOO is kvm1.vm.bytemark.co.uk." )
+ text.push( "FOO2 is kvm2.vm.bytemark.co.uk." )
#
# Test the parser with this text
@@ -203,8 +203,8 @@ EOF
# Input text to parse.
#
text = []
- text.push( "FOO is kvm1.vm.bytemark.co.uk." );
- text.push( "FOO is kvm2.vm.bytemark.co.uk." );
+ text.push( "FOO is kvm1.vm.bytemark.co.uk." )
+ text.push( "FOO is kvm2.vm.bytemark.co.uk." )
#
# Test the parser with this text
diff --git a/t/test-custodian-util-ping.rb b/t/test-custodian-util-ping.rb
index 3dd363a..bf8ac43 100755
--- a/t/test-custodian-util-ping.rb
+++ b/t/test-custodian-util-ping.rb
@@ -64,7 +64,7 @@ class TestPingUtil < Test::Unit::TestCase
#
def test_lookup_ipv4
- helper = Custodian::Util::Ping.new( "ipv4.steve.org.uk" );
+ helper = Custodian::Util::Ping.new( "ipv4.steve.org.uk" )
assert( helper.is_ipv4? )
assert( ! helper.is_ipv6? )
@@ -76,7 +76,7 @@ class TestPingUtil < Test::Unit::TestCase
#
def test_lookup_ipv6
- helper = Custodian::Util::Ping.new( "ipv6.steve.org.uk" );
+ helper = Custodian::Util::Ping.new( "ipv6.steve.org.uk" )
assert( helper.is_ipv6? )
assert( ! helper.is_ipv4? )
end