aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-02-21 20:48:36 -0800
committerAdam Vandenberg2012-02-24 21:35:51 -0800
commit554d5a2670fbc75279dbc0a13b3c9dc94fbef7e6 (patch)
tree38ea9feeef21f22504248e734ee3f82216ba43ae /Library
parent4a64d60dd0ca9910a0bc44e80ec60cf532f1d9ee (diff)
downloadbrew-554d5a2670fbc75279dbc0a13b3c9dc94fbef7e6.tar.bz2
Introduce block form of mkdir
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2ba8f5762..30c8d953b 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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