Updated rubocop and fixed issues (#490)

This commit is contained in:
farhatahmad
2019-05-02 15:44:00 -04:00
committed by Jesus Federico
parent bc57caa806
commit a0c99dde47
15 changed files with 122 additions and 1179 deletions

View File

@ -64,7 +64,7 @@ module BbbApi
def encode_bbb_url(base_url, secret, params, route = 'getUser')
encoded_params = params.to_param
string = route + encoded_params + secret
checksum = OpenSSL::Digest.digest('sha1', string).unpack('H*').first
checksum = OpenSSL::Digest.digest('sha1', string).unpack1('H*')
URI.parse("#{base_url}#{route}?#{encoded_params}&checksum=#{checksum}")
end

View File

@ -12,9 +12,7 @@ namespace :conf do
# Initial check that variables are set
print "\nChecking environment"
ENV_VARIABLES.each do |var|
if ENV[var].blank?
failed("#{var} not set correctly")
end
failed("#{var} not set correctly") if ENV[var].blank?
end
passed
@ -48,8 +46,8 @@ def test_smtp
ENV['SMTP_AUTH']) do |s|
s.sendmail('test', ENV['SMTP_USERNAME'], 'notifications@example.com')
end
rescue => exc
failed("Error connecting to SMTP - #{exc}")
rescue => e
failed("Error connecting to SMTP - #{e}")
end
# Takes the full URL including the protocol
@ -58,11 +56,9 @@ def test_request(url)
res = Net::HTTP.get(uri)
doc = Nokogiri::XML(res)
if doc.css("returncode").text != "SUCCESS"
failed("Could not get a valid response from BigBlueButton server - #{res}")
end
rescue => exc
failed("Error connecting to BigBlueButton server - #{exc}")
failed("Could not get a valid response from BigBlueButton server - #{res}") if doc.css("returncode").text != "SUCCESS"
rescue => e
failed("Error connecting to BigBlueButton server - #{e}")
end
def failed(msg)