aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-02-09 18:43:47 -0800
committerAdam Vandenberg2012-02-09 19:16:49 -0800
commit6b1437ca69ac276ad371b7698dfc4ecbd426fd05 (patch)
tree4d497aeb5804a37e91bdde1eef769000da8ce36e /Library
parent36cdc78dc6108a10b0b575f04bf6dd3adc43d69b (diff)
downloadhomebrew-6b1437ca69ac276ad371b7698dfc4ecbd426fd05.tar.bz2
Allow multiple arguments to install
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 4e21a7c46..1d51ae54d 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -2,14 +2,16 @@ require 'pathname'
# we enhance pathname to make our code more readable
class Pathname
- def install src
- case src
- when Array
- src.collect {|src| install_p(src) }
- when Hash
- src.collect {|src, new_basename| install_p(src, new_basename) }
- else
- install_p(src)
+ def install *sources
+ sources.each do |src|
+ case src
+ when Array
+ src.collect {|src| install_p(src) }
+ when Hash
+ src.collect {|src, new_basename| install_p(src, new_basename) }
+ else
+ install_p(src)
+ end
end
end