aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorJason Karns2017-06-12 17:30:02 -0400
committerJason Karns2017-06-19 09:42:59 -0400
commitc2899b65591c2a966ccfa87f0cdd47dac8fd0781 (patch)
treec8a49c2ebc898a59e45a25b8d36636352e612349 /Library/Homebrew/tap.rb
parentaa364fbf155ba4c795ebef51abee1212801c4771 (diff)
downloadbrew-c2899b65591c2a966ccfa87f0cdd47dac8fd0781.tar.bz2
Tap learns to form its own full_name
full_name is formed from `{user}/homebrew-{repo}` and is always lowercase.
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 66aa10158..e7e610186 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -64,6 +64,11 @@ class Tap
# e.g. `user/repo`
attr_reader :name
+ # The full name of this {Tap}, including the `homebrew-` prefix.
+ # It combines {#user} and 'homebrew-'-prefixed {#repo} with a slash.
+ # e.g. `user/homebrew-repo`
+ attr_reader :full_name
+
# The local path to this {Tap}.
# e.g. `/usr/local/Library/Taps/user/homebrew-repo`
attr_reader :path
@@ -73,7 +78,8 @@ class Tap
@user = user
@repo = repo
@name = "#{@user}/#{@repo}".downcase
- @path = TAP_DIRECTORY/"#{@user}/homebrew-#{@repo}".downcase
+ @full_name = "#{@user}/homebrew-#{@repo}"
+ @path = TAP_DIRECTORY/@full_name.downcase
@path.extend(GitRepositoryExtension)
end
@@ -104,7 +110,7 @@ class Tap
# The default remote path to this {Tap}.
def default_remote
- "https://github.com/#{user}/homebrew-#{repo}"
+ "https://github.com/#{full_name}"
end
# True if this {Tap} is a git repository.
@@ -140,7 +146,7 @@ class Tap
# e.g. `https://github.com/user/homebrew-repo/issues`
def issues_url
return unless official? || !custom_remote?
- "https://github.com/#{user}/homebrew-#{repo}/issues"
+ "#{default_remote}/issues"
end
def to_s
@@ -263,7 +269,7 @@ class Tap
credentials each time you update, you can use git HTTP credential
caching or issue the following command:
cd #{path}
- git remote set-url origin git@github.com:#{user}/homebrew-#{repo}.git
+ git remote set-url origin git@github.com:#{full_name}.git
EOS
end
@@ -513,7 +519,7 @@ class Tap
if custom_remote?
true
else
- GitHub.private_repo?(user, "homebrew-#{repo}")
+ GitHub.private_repo?(full_name)
end
rescue GitHub::HTTPNotFoundError
true