diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:08:33 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:08:33 +0000 |
commit | 3a96cc957dbd97c6ffeaea42f738e7c35b4acbc7 (patch) | |
tree | 1a709ddc989f52f065b681e0ee80265c31647ca4 /lib/custodian/protocoltest | |
parent | d0f94ecdf76f1a3ff9e2d0e5c0f654c2089561cd (diff) |
Avoid "Array.new" and "Hash.new"
Instead use {} + ().
Diffstat (limited to 'lib/custodian/protocoltest')
-rw-r--r-- | lib/custodian/protocoltest/dns.rb | 2 | ||||
-rw-r--r-- | lib/custodian/protocoltest/ldap.rb | 2 | ||||
-rw-r--r-- | lib/custodian/protocoltest/mx.rb | 2 | ||||
-rw-r--r-- | lib/custodian/protocoltest/ping.rb | 2 | ||||
-rw-r--r-- | lib/custodian/protocoltest/tcp.rb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/custodian/protocoltest/dns.rb b/lib/custodian/protocoltest/dns.rb index 7187a75..05c8534 100644 --- a/lib/custodian/protocoltest/dns.rb +++ b/lib/custodian/protocoltest/dns.rb @@ -128,7 +128,7 @@ module Custodian # def resolve_via( server, ltype, name, period ) - results = Array.new() + results = [] begin timeout( period ) do diff --git a/lib/custodian/protocoltest/ldap.rb b/lib/custodian/protocoltest/ldap.rb index fd02623..56203b2 100644 --- a/lib/custodian/protocoltest/ldap.rb +++ b/lib/custodian/protocoltest/ldap.rb @@ -125,7 +125,7 @@ module Custodian else @error = "failed to bind to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" return false - end + .end end rescue LDAP::ResultError => ex @error = "LDAP exception: #{ex} when talking to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" diff --git a/lib/custodian/protocoltest/mx.rb b/lib/custodian/protocoltest/mx.rb index c05283d..29a9183 100644 --- a/lib/custodian/protocoltest/mx.rb +++ b/lib/custodian/protocoltest/mx.rb @@ -63,7 +63,7 @@ module Custodian # # The MX-hosts # - mx = Array.new() + mx = [] # # Lookup the MX record diff --git a/lib/custodian/protocoltest/ping.rb b/lib/custodian/protocoltest/ping.rb index 937a5db..ff406d5 100644 --- a/lib/custodian/protocoltest/ping.rb +++ b/lib/custodian/protocoltest/ping.rb @@ -102,7 +102,7 @@ module Custodian # # Perform the DNS lookups of the specified name. # - ips = Array.new() + ips = [] # # Does the name look like an IP? diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index dd2e52b..9ca2180 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -159,7 +159,7 @@ module Custodian # # Perform the DNS lookups of the specified name. # - ips = Array.new() + ips = [] # # Does the name look like an IP? |