diff options
| author | Jack Nagel | 2014-12-23 01:04:44 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-12-23 01:04:44 -0500 |
| commit | 93516a994b8a3953f49c7a2ae5f450c6a0868fe4 (patch) | |
| tree | 9bc558b1676097436f1f91dbafac2976a31ec099 /Library/Homebrew/download_strategy.rb | |
| parent | c3850b0c71cf22f881b742708bc7470e8f944f05 (diff) | |
| download | homebrew-93516a994b8a3953f49c7a2ae5f450c6a0868fe4.tar.bz2 | |
Document download strategy interface
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 8ae9e1447..1ca262e78 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -13,6 +13,23 @@ class AbstractDownloadStrategy @meta = resource.specs end + # Download and cache the resource as {#cached_location}. + def fetch + end + + # Unpack {#cached_location} into the current working directory. + def stage + end + + # The path to the cached file or directory associated with the resource. + def cached_location + end + + # Remove {#cached_location} and any other files associated with the resource + # from the cache. + def clear_cache + end + def expand_safe_system_args args args = args.dup args.each_with_index do |arg, ii| @@ -34,12 +51,6 @@ class AbstractDownloadStrategy safe_system(*expand_safe_system_args(args)) end - # All download strategies are expected to implement these methods - def fetch; end - def stage; end - def cached_location; end - def clear_cache; end - private def xzpath |
