diff options
| author | Jack Nagel | 2014-12-06 12:29:15 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-12-06 15:02:48 -0500 |
| commit | 6a56c45fbf2e7feb1ad92d2c2269f2a46dc2caca (patch) | |
| tree | e8408c34803e7e9315dfae7ef7fe99e6cb9c6e3a /Library | |
| parent | 645e82df8352e7a902902fafa494c7c300bcc8fd (diff) | |
| download | brew-6a56c45fbf2e7feb1ad92d2c2269f2a46dc2caca.tar.bz2 | |
Mark private VCSDownloadStrategy methods
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 28 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_download_strategies.rb | 2 |
2 files changed, 16 insertions, 14 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 7d6aca1bc..6132f08a7 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -46,19 +46,6 @@ class VCSDownloadStrategy < AbstractDownloadStrategy @clone = HOMEBREW_CACHE.join(cache_filename) 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 @clone end @@ -70,6 +57,21 @@ class VCSDownloadStrategy < AbstractDownloadStrategy def head? resource.version.head? 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 class CurlDownloadStrategy < AbstractDownloadStrategy diff --git a/Library/Homebrew/test/test_download_strategies.rb b/Library/Homebrew/test/test_download_strategies.rb index e7bc75e32..3dabc7af7 100644 --- a/Library/Homebrew/test/test_download_strategies.rb +++ b/Library/Homebrew/test/test_download_strategies.rb @@ -41,7 +41,7 @@ class VCSDownloadStrategyTests < Homebrew::TestCase resource = ResourceDouble.new("http://example.com/bar") strategy = Class.new(VCSDownloadStrategy) { def cache_tag; "foo"; end } downloader = strategy.new("baz", resource) - assert_equal "baz--foo", downloader.cache_filename + assert_equal HOMEBREW_CACHE.join("baz--foo"), downloader.cached_location end end |
