Set bottle download strategy directly

We know what strategy we want, so going through DownloadStrategyDetector
is wasted work. Now we can remove those patterns from the detector and
have two fewer branches each time through.
This commit is contained in:
Jack Nagel 2014-03-18 15:47:26 -05:00
parent aaea4d236a
commit 45bdeadd94
4 changed files with 1 additions and 4 deletions

View File

@ -828,8 +828,6 @@ class DownloadStrategyDetector
SubversionDownloadStrategy
when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/]
MercurialDownloadStrategy
when bottle_native_regex, bottle_regex
CurlBottleDownloadStrategy
else
CurlDownloadStrategy
end

View File

@ -131,6 +131,7 @@ class Bottle
:revision => spec.revision,
:tag => spec.current_tag
)
@resource.download_strategy = CurlBottleDownloadStrategy
@resource.version = f.pkg_version
@resource.checksum = spec.checksum
@prefix = spec.prefix

View File

@ -1,6 +1,5 @@
require 'testing_env'
require 'download_strategy'
require 'bottles' # XXX: hoist these regexps into constants in Pathname?
class ResourceDouble
attr_reader :url, :specs

View File

@ -1,6 +1,5 @@
require 'testing_env'
require 'software_spec'
require 'bottles'
class SoftwareSpecTests < Test::Unit::TestCase
include VersionAssertions