From 881ecc161c1ae075fd79ec44bd8007f12e011485 Mon Sep 17 00:00:00 2001 From: Eli Perkins Date: Tue, 22 Nov 2016 11:37:29 -0500 Subject: [PATCH] Use Octokit::Client for both .com and Enterprise 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. --- lib/github_changelog_generator/octo_fetcher.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/github_changelog_generator/octo_fetcher.rb b/lib/github_changelog_generator/octo_fetcher.rb index 219f4c8..66710c2 100644 --- a/lib/github_changelog_generator/octo_fetcher.rb +++ b/lib/github_changelog_generator/octo_fetcher.rb @@ -23,7 +23,7 @@ module GitHubChangelogGenerator # @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] @@ -40,8 +40,7 @@ module GitHubChangelogGenerator @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