aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-12-13 22:51:21 -0500
committerJack Nagel2014-12-13 23:27:59 -0500
commit0ed43d607b49ba0bee266e11d88fb2d03e6d9ccf (patch)
tree0909c5f324a6d22922107b82c8c93f44bbd1eb54 /Library
parenta3000f3ea9aa53558eaf222333643ab2794e98d4 (diff)
downloadbrew-0ed43d607b49ba0bee266e11d88fb2d03e6d9ccf.tar.bz2
Validate arguments in Resource#stage
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/resource.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb
index f6b417fc5..573a7bcb1 100644
--- a/Library/Homebrew/resource.rb
+++ b/Library/Homebrew/resource.rb
@@ -72,8 +72,11 @@ class Resource
downloader.clear_cache
end
- # Fetch, verify, and unpack the resource
def stage(target=nil, &block)
+ unless target || block
+ raise ArgumentError, "target directory or block is required"
+ end
+
verify_download_integrity(fetch)
unpack(target, &block)
end