Skip to content
Snippets Groups Projects
Commit 4e196a23 authored by Xu Cheng's avatar Xu Cheng
Browse files

tap: add more document

parent f59ad1c9
No related branches found
No related tags found
No related merge requests found
......@@ -149,15 +149,19 @@ class Tap
@command_files ||= Pathname.glob("#{path}/cmd/brew-*").select(&:executable?)
end
# path to the pin record for this {Tap}.
# @private
def pinned_symlink_path
HOMEBREW_LIBRARY/"PinnedTaps/#{@name}"
end
# True if this {Tap} has been pinned.
def pinned?
return @pinned if instance_variable_defined?(:@pinned)
@pinned = pinned_symlink_path.directory?
end
# pin this {Tap}.
def pin
raise TapUnavailableError, name unless installed?
raise TapPinStatusError.new(name, true) if pinned?
......@@ -165,6 +169,7 @@ class Tap
@pinned = true
end
# unpin this {Tap}.
def unpin
raise TapUnavailableError, name unless installed?
raise TapPinStatusError.new(name, false) unless pinned?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment