From 7825e8363d4b2ccad8e2d3f5eeba9e26f6656911 Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 22 Dec 2017 23:08:05 +0000 Subject: Postponing the Bundler merge. I faced a big issue about Bundler with ruby core. I have no time to resolve it issue before 2.5 final release. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/bundler/uri_credentials_filter.rb | 37 ----------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 lib/bundler/uri_credentials_filter.rb (limited to 'lib/bundler/uri_credentials_filter.rb') diff --git a/lib/bundler/uri_credentials_filter.rb b/lib/bundler/uri_credentials_filter.rb deleted file mode 100644 index ee3692268c..0000000000 --- a/lib/bundler/uri_credentials_filter.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -module Bundler - module URICredentialsFilter - module_function - - def credential_filtered_uri(uri_to_anonymize) - return uri_to_anonymize if uri_to_anonymize.nil? - uri = uri_to_anonymize.dup - uri = URI(uri.to_s) unless uri.is_a?(URI) - if uri.userinfo - # oauth authentication - if uri.password == "x-oauth-basic" || uri.password == "x" - # URI as string does not display with password if no user is set - oauth_designation = uri.password - uri.user = oauth_designation - end - uri.password = nil - end - return uri if uri_to_anonymize.is_a?(URI) - return uri.to_s if uri_to_anonymize.is_a?(String) - rescue URI::InvalidURIError # uri is not canonical uri scheme - uri - end - - def credential_filtered_string(str_to_filter, uri) - return str_to_filter if uri.nil? || str_to_filter.nil? - str_with_no_credentials = str_to_filter.dup - anonymous_uri_str = credential_filtered_uri(uri).to_s - uri_str = uri.to_s - if anonymous_uri_str != uri_str - str_with_no_credentials = str_with_no_credentials.gsub(uri_str, anonymous_uri_str) - end - str_with_no_credentials - end - end -end -- cgit v1.2.3