From 2e7758b4e9b65b8a83acf6041c35607fa46605b0 Mon Sep 17 00:00:00 2001 From: Alexander Mancevice Date: Fri, 19 Oct 2018 15:38:39 -0400 Subject: [PATCH] Fix to deprecated S3DownloadStrategy Remove references to removed require_aws_sdk method See commit: 599ecc9b5ad7951b8ddc51490ebe93a976d43b29 --- Library/Homebrew/compat/download_strategy.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/compat/download_strategy.rb b/Library/Homebrew/compat/download_strategy.rb index d4b476a260..23879d5078 100644 --- a/Library/Homebrew/compat/download_strategy.rb +++ b/Library/Homebrew/compat/download_strategy.rb @@ -26,6 +26,13 @@ class S3DownloadStrategy < CurlDownloadStrategy ENV["AWS_ACCESS_KEY_ID"] = ENV["HOMEBREW_AWS_ACCESS_KEY_ID"] ENV["AWS_SECRET_ACCESS_KEY"] = ENV["HOMEBREW_AWS_SECRET_ACCESS_KEY"] + begin + require "aws-sdk-s3" + rescue LoadError + Homebrew.install_gem! "aws-sdk-s3", "~> 1.8" + require "aws-sdk-s3" + end + begin signer = Aws::S3::Presigner.new s3url = signer.presigned_url :get_object, bucket: bucket, key: key @@ -204,12 +211,6 @@ end class DownloadStrategyDetector class << self module Compat - def detect(url, using = nil) - strategy = super - require_aws_sdk if strategy == S3DownloadStrategy - strategy - end - def detect_from_url(url) case url when %r{^s3://}