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
commitccd31a2dd26ce5db8f247f8261e808702d061454 (patch)
treedae0ca604aad50134cf2b69ef98b53849f76c532 /Library
parentdcb9ae1bcc8adaad088013aecb17c0fb4d120b1e (diff)
downloadbrew-ccd31a2dd26ce5db8f247f8261e808702d061454.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/(.+)}