
There are plenty of IO operations inside Tap object, and it will be more when implementing formula alias reverse look up(e.g. list all of alias names for a formula). So let's cache them. Some benchmark: $ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null Before: 6.40s user 2.42s system 96% cpu 9.134 total After: 4.75s user 0.77s system 97% cpu 5.637 total Closes Homebrew/homebrew#44377. Signed-off-by: Xu Cheng <xucheng@me.com>
12 lines
188 B
Ruby
12 lines
188 B
Ruby
require "cmd/tap"
|
|
|
|
module Homebrew
|
|
def tap_unpin
|
|
ARGV.named.each do |name|
|
|
tap = Tap.fetch(*tap_args(name))
|
|
tap.unpin
|
|
ohai "Unpinned #{tap.name}"
|
|
end
|
|
end
|
|
end
|