lib/jss/api_connection.rb in ruby-jss-1.0.3b2 vs lib/jss/api_connection.rb in ruby-jss-1.0.3b3

- old
+ new

@@ -1,6 +1,6 @@ -### Copyright 2018 Pixar +### Copyright 2019 Pixar ### ### Licensed under the Apache License, Version 2.0 (the "Apache License") ### with the following modification; you may not use this file except in ### compliance with the Apache License and the following modification to it: ### Section 6. Trademarks. is deleted and replaced with: @@ -437,10 +437,13 @@ # def connect(args = {}) args[:no_port_specified] = args[:port].to_s.empty? args = apply_connection_defaults args + # ensure an integer + args[:port] &&= args[:port].to_i + # confirm we know basics verify_basic_args args # parse our ssl situation verify_ssl args @@ -1111,20 +1114,15 @@ # @param args[Hash] The args for #connect # # @return [Type] description_of_returned_object # def verify_ssl(args) - # use SSL for those ports unless specifically told not to + # use SSL for SSL ports unless specifically told not to if SSL_PORTS.include? args[:port] - args[:use_ssl] = true if args[:use_ssl].nil? + args[:use_ssl] = true unless args[:use_ssl] == false end # if verify_cert is anything but false, we will verify - args[:verify_ssl] = - if args[:verify_cert] == false - OpenSSL::SSL::VERIFY_NONE - else - OpenSSL::SSL::VERIFY_PEER - end + args[:verify_ssl] = args[:verify_cert] == false ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER end # Parses the HTTP body of a RestClient::ExceptionWithResponse # (the parent of all HTTP error responses) and its subclasses # and re-raises a JSS::APIError with a more