aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-07-16 23:19:58 -0500
committerJack Nagel2014-07-16 23:22:04 -0500
commit7510e0673e262c4e8413baeeeb8d8562d78a6c0c (patch)
tree13ad64f4f9a217c4ba9317f777d723ef4e40e18e /Library
parent74793c86bfe26b5334b3d98beee3e1e715d7d07f (diff)
downloadhomebrew-7510e0673e262c4e8413baeeeb8d8562d78a6c0c.tar.bz2
Remove more dead code
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb8
-rw-r--r--Library/Homebrew/test/test_download_strategies.rb17
2 files changed, 9 insertions, 16 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 0a025da1b..859e09d40 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -43,7 +43,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
def initialize name, resource
super
@ref_type, @ref = extract_ref(resource.specs)
- @clone = HOMEBREW_CACHE/cache_filename
+ @clone = HOMEBREW_CACHE.join(cache_filename)
end
def extract_ref(specs)
@@ -51,8 +51,8 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
return key, specs[key]
end
- def cache_filename(tag=cache_tag)
- "#{name}--#{tag}"
+ def cache_filename
+ "#{name}--#{cache_tag}"
end
def cache_tag
@@ -634,7 +634,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy
unless @clone.exist?
HOMEBREW_CACHE.cd do
safe_system cvspath, '-d', url, 'login'
- safe_system cvspath, '-d', url, 'checkout', '-d', cache_filename("cvs"), mod
+ safe_system cvspath, '-d', url, 'checkout', '-d', cache_filename, mod
end
else
puts "Updating #{@clone}"
diff --git a/Library/Homebrew/test/test_download_strategies.rb b/Library/Homebrew/test/test_download_strategies.rb
index b228c563a..e7bc75e32 100644
--- a/Library/Homebrew/test/test_download_strategies.rb
+++ b/Library/Homebrew/test/test_download_strategies.rb
@@ -37,18 +37,11 @@ class AbstractDownloadStrategyTests < Homebrew::TestCase
end
class VCSDownloadStrategyTests < Homebrew::TestCase
- def setup
- @resource = ResourceDouble.new("http://example.com/bar")
- @strategy = VCSDownloadStrategy
- end
-
- def escaped(tag)
- "#{ERB::Util.url_encode(@resource.url)}--#{tag}"
- end
-
- def test_explicit_name
- downloader = @strategy.new("baz", @resource)
- assert_equal "baz--foo", downloader.cache_filename("foo")
+ def test_cache_filename
+ 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
end
end