aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-04-24 18:26:05 -0500
committerJack Nagel2014-04-24 18:26:05 -0500
commitf9d8050b3b15c272b1ec00ecacdeceda04232eb9 (patch)
treef49df7933c2bcb7e7e5e7b11156ffffd9545a013 /Library
parent67a064b79181d365a6605d7a951e257a057a6480 (diff)
downloadhomebrew-f9d8050b3b15c272b1ec00ecacdeceda04232eb9.tar.bz2
Pass arguments instead of reopening Pathname
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/tap.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index 860b4a0a1..2cc450563 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -61,7 +61,7 @@ module Homebrew extend self
to.make_relative_symlink(from)
rescue SystemCallError
to = to.realpath if to.exist?
- opoo "Could not tap #{Tty.white}#{from.tap_ref}#{Tty.reset} over #{Tty.white}#{to.tap_ref}#{Tty.reset}"
+ opoo "Could not tap #{Tty.white}#{tap_ref(from)}#{Tty.reset} over #{Tty.white}#{tap_ref(to)}#{Tty.reset}"
else
ignores << formula.basename.to_s
tapped += 1
@@ -115,12 +115,9 @@ module Homebrew extend self
rescue GitHub::Error
false
end
-end
-
-class Pathname
- def tap_ref
- case self.to_s
+ def tap_ref(path)
+ case path.to_s
when %r{^#{HOMEBREW_LIBRARY}/Taps/([\w_-]+)/([\w_-]+)/(.+)}
"#$1/#$2/#{File.basename($3, '.rb')}"
when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)}