Detect bottle download strategy

Use ::detect method of DownloadStrategyDetector to detect download strategy of a bottle from its root_url.

This allows bottle root_urls to be s3:// style URLs and be handled by the S3DownloadStrategy without specifying ':using =>'
This commit is contained in:
Alexander Mancevice 2018-03-25 13:45:58 -04:00
parent f37b0bc987
commit 138d4df710

View File

@ -318,7 +318,7 @@ class Bottle
end
def select_download_strategy(specs)
specs[:using] ||= CurlDownloadStrategy
specs[:using] ||= DownloadStrategyDetector.detect(@spec.root_url)
specs
end
end