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:
parent
aaea4d236a
commit
45bdeadd94
@ -828,8 +828,6 @@ class DownloadStrategyDetector
|
||||
SubversionDownloadStrategy
|
||||
when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/]
|
||||
MercurialDownloadStrategy
|
||||
when bottle_native_regex, bottle_regex
|
||||
CurlBottleDownloadStrategy
|
||||
else
|
||||
CurlDownloadStrategy
|
||||
end
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
require 'testing_env'
|
||||
require 'software_spec'
|
||||
require 'bottles'
|
||||
|
||||
class SoftwareSpecTests < Test::Unit::TestCase
|
||||
include VersionAssertions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user