Class: GemContribute::HostAdapter
- Inherits:
-
Object
- Object
- GemContribute::HostAdapter
- Defined in:
- lib/gem_contribute/host_adapter.rb
Overview
Abstract host adapter. Concrete implementations (GitHubAdapter, future GitLabAdapter, future CodebergAdapter) conform to this interface so the rest of the app — Operations, CLI verbs, TUI — doesn’t have to special-case anything beyond looking up the right adapter for a project’s host.
See ADR-0011: HostAdapter owns the host-API verbs (fork, comment, pull_request_url) plus the host-specific URL templating (clone_url, repo_url). Higher layers compose those primitives; they don’t construct host URLs themselves.
Public-API methods (no auth needed):
issues(project, labels:)
issue(project, number)
issue_comments(project, number)
community_profile(project)
file_contents(project, path)
search_issues(query)
clone_url(owner, repo)
repo_url(owner, repo)
Auth-required methods (raise AuthRequired without a cached token):
fork(project) — idempotent, blocks until the fork is reachable
comment(project, issue:, body:)
pull_request_url(upstream, head_owner:, head_branch:, title:, body:)
viewer_login
See ADR-0001 for the JIT auth contract.
Direct Known Subclasses
Defined Under Namespace
Classes: ForkResult
Instance Method Summary collapse
- #clone_url(_owner, _repo) ⇒ Object
- #comment(_project, issue:, body:) ⇒ Object
- #community_profile(_project) ⇒ Object
- #file_contents(_project, _path) ⇒ Object
- #fork(_project) ⇒ Object
- #issue(_project, _number) ⇒ Object
- #issue_comments(_project, _number) ⇒ Object
- #issues(_project, labels: nil) ⇒ Object
- #pull_request_url(_upstream, head_owner:, head_branch:, title:, body:) ⇒ Object
- #repo_url(_owner, _repo) ⇒ Object
- #search_issues(_query) ⇒ Object
- #viewer_login ⇒ Object
Instance Method Details
#clone_url(_owner, _repo) ⇒ Object
79 80 81 |
# File 'lib/gem_contribute/host_adapter.rb', line 79 def clone_url(_owner, _repo) raise NotImplementedError end |
#comment(_project, issue:, body:) ⇒ Object
67 68 69 |
# File 'lib/gem_contribute/host_adapter.rb', line 67 def comment(_project, issue:, body:) raise NotImplementedError end |
#community_profile(_project) ⇒ Object
51 52 53 |
# File 'lib/gem_contribute/host_adapter.rb', line 51 def community_profile(_project) raise NotImplementedError end |
#file_contents(_project, _path) ⇒ Object
55 56 57 |
# File 'lib/gem_contribute/host_adapter.rb', line 55 def file_contents(_project, _path) raise NotImplementedError end |
#fork(_project) ⇒ Object
63 64 65 |
# File 'lib/gem_contribute/host_adapter.rb', line 63 def fork(_project) raise NotImplementedError end |
#issue(_project, _number) ⇒ Object
43 44 45 |
# File 'lib/gem_contribute/host_adapter.rb', line 43 def issue(_project, _number) raise NotImplementedError end |
#issue_comments(_project, _number) ⇒ Object
47 48 49 |
# File 'lib/gem_contribute/host_adapter.rb', line 47 def issue_comments(_project, _number) raise NotImplementedError end |
#issues(_project, labels: nil) ⇒ Object
39 40 41 |
# File 'lib/gem_contribute/host_adapter.rb', line 39 def issues(_project, labels: nil) raise NotImplementedError end |
#pull_request_url(_upstream, head_owner:, head_branch:, title:, body:) ⇒ Object
71 72 73 |
# File 'lib/gem_contribute/host_adapter.rb', line 71 def pull_request_url(_upstream, head_owner:, head_branch:, title:, body:) raise NotImplementedError end |
#repo_url(_owner, _repo) ⇒ Object
83 84 85 |
# File 'lib/gem_contribute/host_adapter.rb', line 83 def repo_url(_owner, _repo) raise NotImplementedError end |
#search_issues(_query) ⇒ Object
59 60 61 |
# File 'lib/gem_contribute/host_adapter.rb', line 59 def search_issues(_query) raise NotImplementedError end |
#viewer_login ⇒ Object
75 76 77 |
# File 'lib/gem_contribute/host_adapter.rb', line 75 def viewer_login raise NotImplementedError end |