mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Mark private VCSDownloadStrategy methods
This commit is contained in:
parent
645e82df83
commit
6a56c45fbf
@ -46,19 +46,6 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
@clone = HOMEBREW_CACHE.join(cache_filename)
|
@clone = HOMEBREW_CACHE.join(cache_filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_ref(specs)
|
|
||||||
key = REF_TYPES.find { |type| specs.key?(type) }
|
|
||||||
return key, specs[key]
|
|
||||||
end
|
|
||||||
|
|
||||||
def cache_filename
|
|
||||||
"#{name}--#{cache_tag}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def cache_tag
|
|
||||||
"__UNKNOWN__"
|
|
||||||
end
|
|
||||||
|
|
||||||
def cached_location
|
def cached_location
|
||||||
@clone
|
@clone
|
||||||
end
|
end
|
||||||
@ -70,6 +57,21 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
def head?
|
def head?
|
||||||
resource.version.head?
|
resource.version.head?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def cache_tag
|
||||||
|
"__UNKNOWN__"
|
||||||
|
end
|
||||||
|
|
||||||
|
def cache_filename
|
||||||
|
"#{name}--#{cache_tag}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def extract_ref(specs)
|
||||||
|
key = REF_TYPES.find { |type| specs.key?(type) }
|
||||||
|
return key, specs[key]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class CurlDownloadStrategy < AbstractDownloadStrategy
|
class CurlDownloadStrategy < AbstractDownloadStrategy
|
||||||
|
@ -41,7 +41,7 @@ class VCSDownloadStrategyTests < Homebrew::TestCase
|
|||||||
resource = ResourceDouble.new("http://example.com/bar")
|
resource = ResourceDouble.new("http://example.com/bar")
|
||||||
strategy = Class.new(VCSDownloadStrategy) { def cache_tag; "foo"; end }
|
strategy = Class.new(VCSDownloadStrategy) { def cache_tag; "foo"; end }
|
||||||
downloader = strategy.new("baz", resource)
|
downloader = strategy.new("baz", resource)
|
||||||
assert_equal "baz--foo", downloader.cache_filename
|
assert_equal HOMEBREW_CACHE.join("baz--foo"), downloader.cached_location
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user