diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 8fd9dc7b3fce999d686104118c58e34989964b5d..8b3ce4c33518fc7914e5c0a4d7c2cddec263fcc2 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -43,12 +43,16 @@ class Resource downloader.cached_location end - # Download the resource + # Fetch, verify, and unpack the resource + def stage(target=nil, &block) + verify_download_integrity(fetch) + unpack(target, &block) + end + # If a target is given, unpack there; else unpack to a temp folder # If block is given, yield to that block # A target or a block must be given, but not both - def stage(target=nil) - verify_download_integrity(fetch) + def unpack(target=nil) mktemp(download_name) do downloader.stage if block_given?