aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorXu Cheng2015-11-07 16:00:45 +0800
committerXu Cheng2015-11-09 15:34:20 +0800
commit4e196a23483799ce114169b8b07cb3e195c107d3 (patch)
treeb5ce45b156d0f4bb8094ec584e5126d714ec4533 /Library/Homebrew
parentf59ad1c9e91b0d9d39287a51d1a3b009b622cec0 (diff)
downloadbrew-4e196a23483799ce114169b8b07cb3e195c107d3.tar.bz2
tap: add more document
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/tap.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index f97383634..436ff89cc 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -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?