Introduce block form of mkdir

This commit is contained in:
Adam Vandenberg 2012-02-21 20:48:36 -08:00
parent 4a64d60dd0
commit 554d5a2670

View File

@ -123,6 +123,16 @@ class Formula
def plist_name; 'homebrew.mxcl.'+name end
def plist_path; prefix+(plist_name+'.plist') end
# A version of mkdir that also changes to that folder in a block
def mkdir name, &block
FileUtils.mkdir name
if block_given?
FileUtils.chdir name do
yield
end
end
end
# Use the @spec_to_use to detect the download strategy.
# Can be overriden to force a custom download strategy
def download_strategy