Class: QB::GitHub::RepoID
- Inherits:
-
Util::Resource
- Object
- NRSER::Meta::Props::Base
- Util::Resource
- QB::GitHub::RepoID
- Defined in:
- lib/qb/github/repo_id.rb
Overview
Unique identifier for a GitHub repo, which is a composite of an owner
and a name
string.
Instance Method Summary collapse
-
#git_https_url ⇒ String
HTTPS protocol URL string for use as a Git remote.
-
#git_ssh_url ⇒ String
SSH protocol URL string for use as a Git remote.
-
#git_url(protocol) ⇒ String
Return #git_ssh_url or #git_https_url depending on
protocol
parameter. -
#path ⇒ String
(also: #full_name, #to_s)
"Path" on GitHub for the repo - the
<owner>/<name>
part that comes after the host in URLs.
Instance Method Details
#git_https_url ⇒ String
HTTPS protocol URL string for use as a Git remote.
106 107 108 |
# File 'lib/qb/github/repo_id.rb', line 106 def git_https_url "https://github.com/#{ path }.git" end |
#git_ssh_url ⇒ String
SSH protocol URL string for use as a Git remote.
92 93 94 |
# File 'lib/qb/github/repo_id.rb', line 92 def git_ssh_url "[email protected]:#{ path }.git" end |
#git_url(protocol) ⇒ String
Return #git_ssh_url or #git_https_url depending on protocol
parameter.
120 121 122 123 124 |
# File 'lib/qb/github/repo_id.rb', line 120 def git_url protocol t.match protocol, :ssh, ->( _ ) { git_ssh_url }, :https, ->( _ ) { git_https_url } end |
#path ⇒ String Also known as: full_name, to_s
"Path" on GitHub for the repo - the <owner>/<name>
part that comes
after the host in URLs.
Called full_name
in GitHub API (we include a #full_name
method alias
as well).
This is also what we return for #to_s.
75 76 77 |
# File 'lib/qb/github/repo_id.rb', line 75 def path "#{ owner }/#{ name }" end |