Revert "Skip temporary directory when target directory is known"

This reverts commit 028ee18b851497f8aede55004bcdcc5c16f087cc.
This commit is contained in:
Jack Nagel 2014-12-14 17:59:35 -05:00
parent 5ca4dbfd25
commit 9a89878b75

View File

@ -85,13 +85,13 @@ class Resource
# If block is given, yield to that block # If block is given, yield to that block
# A target or a block must be given, but not both # A target or a block must be given, but not both
def unpack(target=nil) def unpack(target=nil)
if target mktemp(download_name) do
mkdir_p(target) downloader.stage
chdir(target) { downloader.stage } if block_given?
elsif block_given?
mktemp(download_name) do
downloader.stage
yield self yield self
elsif target
target = Pathname.new(target) unless target.is_a? Pathname
target.install Dir['*']
end end
end end
end end