aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/install_renamed.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-10-05 20:29:02 +0100
committerMike McQuaid2013-10-10 16:46:47 +0100
commitf4d29a04943a390e39f7ce51a7f2d45a595592ca (patch)
treedf712d3367c6a98404c5ad873b0d9629131d8bb1 /Library/Homebrew/install_renamed.rb
parent8db4a6c18d3f69a1aa41b9db17b63ae751ef1ff8 (diff)
downloadhomebrew-f4d29a04943a390e39f7ce51a7f2d45a595592ca.tar.bz2
Pathname: add cp_path_sub method.
This method allows copying a file to a new location by performing a substitution on the pathname.
Diffstat (limited to 'Library/Homebrew/install_renamed.rb')
-rw-r--r--Library/Homebrew/install_renamed.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/install_renamed.rb b/Library/Homebrew/install_renamed.rb
index e0a69beec..5f34eb674 100644
--- a/Library/Homebrew/install_renamed.rb
+++ b/Library/Homebrew/install_renamed.rb
@@ -6,6 +6,12 @@ module InstallRenamed
end
end
+ def cp_path_sub pattern, replacement
+ super do |src, dst|
+ append_default_if_different(src, dst)
+ end
+ end
+
private
def append_default_if_different src, dst