Skip to content

Commit

Permalink
Use Octokit::Client for both .com and Enterprise
Browse files Browse the repository at this point in the history
Octokit:EnterpriseAdminClient is only meant to be used for GHE admin
panel endpoints, such as Admin Stats, Management Console, etc.

This repairs GHE functionality by passing the API endpoint parameters
into Octokit::Client and letting it handle the rest.
  • Loading branch information
eliperkins committed Nov 22, 2016
1 parent 88cbcd2 commit 881ecc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/github_changelog_generator/octo_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OctoFetcher
# @option options [Boolean] :http_cache Use ActiveSupport::Cache::FileStore to cache http requests
# @option options [Boolean] :cache_file If using http_cache, this is the cache file path
# @option options [Boolean] :cache_log If using http_cache, this is the cache log file path
def initialize(options = {}) # rubocop:disable Metrics/CyclomaticComplexity
def initialize(options = {})
@options = options || {}
@user = @options[:user]
@project = @options[:project]
Expand All @@ -40,8 +40,7 @@ def initialize(options = {}) # rubocop:disable Metrics/CyclomaticComplexity
@github_options[:access_token] = @github_token unless @github_token.nil?
@github_options[:api_endpoint] = @options[:github_endpoint] unless @options[:github_endpoint].nil?

client_type = @options[:github_endpoint].nil? ? Octokit::Client : Octokit::EnterpriseAdminClient
@client = client_type.new(@github_options)
@client = Octokit::Client.new(@github_options)
end

def init_cache
Expand Down

0 comments on commit 881ecc1

Please sign in to comment.