diff options
| author | Jack Nagel | 2013-04-15 15:00:57 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-04-15 15:00:57 -0500 |
| commit | 841c8bedcaab1417d4745319d2dec02c81b4cfae (patch) | |
| tree | d22e5c9c835c2cb5f89420a602e92881f3734534 /Library | |
| parent | 010a1461f7fd02f14b9cfe9bd3c9018fddcb4431 (diff) | |
| download | brew-841c8bedcaab1417d4745319d2dec02c81b4cfae.tar.bz2 | |
Clean up remaining DownloadStrategy initializers
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 9548a268b..013cc4ab2 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -470,7 +470,8 @@ class CVSDownloadStrategy < AbstractDownloadStrategy if name.to_s.empty? || name == '__UNKNOWN__' raise NotImplementedError, "strategy requires a name parameter" else - @co = HOMEBREW_CACHE + "#{name}--cvs" + @unique_token = "#{name}--cvs" + @co = Pathname.new("#{HOMEBREW_CACHE}/#{@unique_token}") end end @@ -521,8 +522,12 @@ end class MercurialDownloadStrategy < AbstractDownloadStrategy def initialize name, package super - @unique_token="#{name}--hg" unless name.to_s.empty? or name == '__UNKNOWN__' - @clone=HOMEBREW_CACHE+@unique_token + + if name.to_s.empty? || name == '__UNKNOWN__' + raise NotImplementedError, "strategy requires a name parameter" + else + @clone = Pathname.new("#{HOMEBREW_CACHE}/#{name}--hg") + end end def cached_location; @clone; end @@ -568,8 +573,12 @@ end class BazaarDownloadStrategy < AbstractDownloadStrategy def initialize name, package super - @unique_token="#{name}--bzr" unless name.to_s.empty? or name == '__UNKNOWN__' - @clone=HOMEBREW_CACHE+@unique_token + + if name.to_s.empty? || name == '__UNKNOWN__' + raise NotImplementedError, "strategy requires a name parameter" + else + @clone = Pathname.new("#{HOMEBREW_CACHE}/#{name}--bzr") + end end def cached_location; @clone; end @@ -618,8 +627,11 @@ end class FossilDownloadStrategy < AbstractDownloadStrategy def initialize name, package super - @unique_token="#{name}--fossil" unless name.to_s.empty? or name == '__UNKNOWN__' - @clone=HOMEBREW_CACHE+@unique_token + if name.to_s.empty? || name == '__UNKNOWN__' + raise NotImplementedError, "strategy requires a name parameter" + else + @clone = Pathname.new("#{HOMEBREW_CACHE}/#{name}--fossil") + end end def cached_location; @clone; end |
