tap various commands: use tap name method.

Instead of hard coded `Homebrew/homebrew`
This commit is contained in:
Xu Cheng 2016-03-07 18:08:37 +08:00
parent a3023c3ce8
commit 1e487edd21
4 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ module Homebrew
end end
end end
raise "Homebrew/homebrew is not allowed" if taps.any?(&:core_tap?) raise "#{tap} is not allowed" if taps.any?(&:core_tap?)
if ARGV.json == "v1" if ARGV.json == "v1"
print_tap_json(taps) print_tap_json(taps)

View File

@ -4,9 +4,9 @@ module Homebrew
def tap_pin def tap_pin
ARGV.named.each do |name| ARGV.named.each do |name|
tap = Tap.fetch(name) tap = Tap.fetch(name)
raise "Homebrew/homebrew is not allowed" if tap.core_tap? raise "#{tap} is not allowed" if tap.core_tap?
tap.pin tap.pin
ohai "Pinned #{tap.name}" ohai "Pinned #{tap}"
end end
end end
end end

View File

@ -4,9 +4,9 @@ module Homebrew
def tap_unpin def tap_unpin
ARGV.named.each do |name| ARGV.named.each do |name|
tap = Tap.fetch(name) tap = Tap.fetch(name)
raise "Homebrew/homebrew is not allowed" if tap.core_tap? raise "#{tap} is not allowed" if tap.core_tap?
tap.unpin tap.unpin
ohai "Unpinned #{tap.name}" ohai "Unpinned #{tap}"
end end
end end
end end

View File

@ -6,7 +6,7 @@ module Homebrew
ARGV.named.each do |tapname| ARGV.named.each do |tapname|
tap = Tap.fetch(tapname) tap = Tap.fetch(tapname)
raise "Homebrew/homebrew is not allowed" if tap.core_tap? raise "#{tap} is not allowed" if tap.core_tap?
tap.uninstall tap.uninstall
end end
end end