tap: cleanup remote_repo method

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Rylan Polster 2021-03-22 08:54:38 -04:00 committed by GitHub
parent 4e61f61a20
commit 0b214da4eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,10 @@ class Tap
def remote_repo
raise TapUnavailableError, name unless installed?
@remote_repo ||= remote&.sub(%r{^https://github\.com/}, "")&.sub(/\.git$/, "")
return unless remote
@remote_repo ||= remote.delete_prefix("https://github.com/")
.delete_suffix(".git")
end
# The default remote path to this {Tap}.