Validate arguments in Resource#stage

This commit is contained in:
Jack Nagel 2014-12-13 22:51:21 -05:00
parent a3000f3ea9
commit 0ed43d607b

View File

@ -72,8 +72,11 @@ class Resource
downloader.clear_cache downloader.clear_cache
end end
# Fetch, verify, and unpack the resource
def stage(target=nil, &block) def stage(target=nil, &block)
unless target || block
raise ArgumentError, "target directory or block is required"
end
verify_download_integrity(fetch) verify_download_integrity(fetch)
unpack(target, &block) unpack(target, &block)
end end