tap: add more document
This commit is contained in:
parent
f59ad1c9e9
commit
4e196a2348
@ -149,15 +149,19 @@ class Tap
|
|||||||
@command_files ||= Pathname.glob("#{path}/cmd/brew-*").select(&:executable?)
|
@command_files ||= Pathname.glob("#{path}/cmd/brew-*").select(&:executable?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# path to the pin record for this {Tap}.
|
||||||
|
# @private
|
||||||
def pinned_symlink_path
|
def pinned_symlink_path
|
||||||
HOMEBREW_LIBRARY/"PinnedTaps/#{@name}"
|
HOMEBREW_LIBRARY/"PinnedTaps/#{@name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# True if this {Tap} has been pinned.
|
||||||
def pinned?
|
def pinned?
|
||||||
return @pinned if instance_variable_defined?(:@pinned)
|
return @pinned if instance_variable_defined?(:@pinned)
|
||||||
@pinned = pinned_symlink_path.directory?
|
@pinned = pinned_symlink_path.directory?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# pin this {Tap}.
|
||||||
def pin
|
def pin
|
||||||
raise TapUnavailableError, name unless installed?
|
raise TapUnavailableError, name unless installed?
|
||||||
raise TapPinStatusError.new(name, true) if pinned?
|
raise TapPinStatusError.new(name, true) if pinned?
|
||||||
@ -165,6 +169,7 @@ class Tap
|
|||||||
@pinned = true
|
@pinned = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# unpin this {Tap}.
|
||||||
def unpin
|
def unpin
|
||||||
raise TapUnavailableError, name unless installed?
|
raise TapUnavailableError, name unless installed?
|
||||||
raise TapPinStatusError.new(name, false) unless pinned?
|
raise TapPinStatusError.new(name, false) unless pinned?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user