aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-02-18 09:55:47 -0800
committerAdam Vandenberg2010-03-07 11:24:22 -0800
commitfabb640b062bf4b78f67c2db90fe8253e4384ab3 (patch)
tree9ab3539e64f989b619b5d999d19f61fa4bfd5da6 /Library
parent2e6405cabc78ca1ecbce17ed177a712c812e91fd (diff)
downloadhomebrew-fabb640b062bf4b78f67c2db90fe8253e4384ab3.tar.bz2
Allow Pathname.install to take a Hash.
The keys of the hash are original file names, the values are new file names. Originals are renamed, and then installed under the new name.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 1abb51f59..3e0837206 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -5,6 +5,11 @@ class Pathname
def install src
if src.is_a? Array
src.collect {|src| install src }
+ elsif src.is_a? Hash
+ src.each_pair do |name, new_name|
+ FileUtils.mv name, new_name
+ install new_name
+ end
else
# if it's a symlink, don't resolve it to a file because if we are moving
# files one by one, it's likely we will break the symlink by moving what