Class: ModuleSync::GitService::GitHub

Inherits:
Base
  • Object
show all
Defined in:
lib/modulesync/git_service/github.rb

Overview

GitHub creates and manages pull requests on github.com or GitHub Enterprise installations.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

extract_hostname, #open_pull_request

Constructor Details

#initialize(token, endpoint) ⇒ GitHub

Returns a new instance of GitHub.



12
13
14
15
16
17
18
19
# File 'lib/modulesync/git_service/github.rb', line 12

def initialize(token, endpoint)
  super()

  Octokit.configure do |c|
    c.api_endpoint = endpoint
  end
  @api = Octokit::Client.new(access_token: token)
end

Class Method Details

.guess_endpoint_from(remote:) ⇒ Object



21
22
23
24
25
26
# File 'lib/modulesync/git_service/github.rb', line 21

def self.guess_endpoint_from(remote:)
  endpoint = super
  return 'https://api.github.com' if endpoint == 'https://github.com'

  endpoint
end