Class: GemContribute::HostAdapter

Inherits:
Object
  • Object
show all
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.

Defined Under Namespace

Classes: ForkResult

Instance Method Summary collapse

Instance Method Details

#clone_url(_owner, _repo) ⇒ Object

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


67
68
69
# File 'lib/gem_contribute/host_adapter.rb', line 67

def comment(_project, issue:, body:)
  raise NotImplementedError
end

#community_profile(_project) ⇒ Object

Raises:

  • (NotImplementedError)


51
52
53
# File 'lib/gem_contribute/host_adapter.rb', line 51

def community_profile(_project)
  raise NotImplementedError
end

#file_contents(_project, _path) ⇒ Object

Raises:

  • (NotImplementedError)


55
56
57
# File 'lib/gem_contribute/host_adapter.rb', line 55

def file_contents(_project, _path)
  raise NotImplementedError
end

#fork(_project) ⇒ Object

Raises:

  • (NotImplementedError)


63
64
65
# File 'lib/gem_contribute/host_adapter.rb', line 63

def fork(_project)
  raise NotImplementedError
end

#issue(_project, _number) ⇒ Object

Raises:

  • (NotImplementedError)


43
44
45
# File 'lib/gem_contribute/host_adapter.rb', line 43

def issue(_project, _number)
  raise NotImplementedError
end

#issue_comments(_project, _number) ⇒ Object

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


83
84
85
# File 'lib/gem_contribute/host_adapter.rb', line 83

def repo_url(_owner, _repo)
  raise NotImplementedError
end

#search_issues(_query) ⇒ Object

Raises:

  • (NotImplementedError)


59
60
61
# File 'lib/gem_contribute/host_adapter.rb', line 59

def search_issues(_query)
  raise NotImplementedError
end

#viewer_loginObject

Raises:

  • (NotImplementedError)


75
76
77
# File 'lib/gem_contribute/host_adapter.rb', line 75

def 
  raise NotImplementedError
end