From 073a42abc79509074f632d94da09f9ec57dce768 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Fri, 11 Aug 2017 14:16:30 +0200 Subject: [PATCH] Remove newer Ruby syntax This gem also needs to be backported to older GitHub Enterprise releases who are not on a Ruby version that supports this syntax. --- lib/service.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/service.rb b/lib/service.rb index 5330c2098..e7dd61788 100644 --- a/lib/service.rb +++ b/lib/service.rb @@ -531,7 +531,7 @@ def shorten_url(url) url end - ENABLED_TRANSPORTS = [nil, "http", "https"] + ENABLED_TRANSPORTS = ["", "http", "https"] # Public: Makes an HTTP GET call. # @@ -646,8 +646,8 @@ def http_method(method, url = nil, body = nil, headers = nil) end def permitted_transport?(url = nil) - ENABLED_TRANSPORTS.include?(http.url_prefix.scheme&.downcase) && - ENABLED_TRANSPORTS.include?(Addressable::URI.parse(url).scheme&.downcase) + ENABLED_TRANSPORTS.include?(http.url_prefix.scheme.to_s.downcase) && + ENABLED_TRANSPORTS.include?(Addressable::URI.parse(url).scheme.to_s.downcase) end # Public: Lazily loads the Faraday::Connection for the current Service