Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

support enterprise github via command line options#42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
skywinder merged 1 commit intogithub-changelog-generator:masterfromglenlovett:enterprise_github
Jan 15, 2015
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletionslib/github_changelog_generator.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,12 +28,12 @@ def initialize

github_token

if @github_token.nil?
@github = Github.new per_page: PER_PAGE_NUMBER
else
@github = Github.new oauth_token: @github_token,
per_page: PER_PAGE_NUMBER
end
github_options = {per_page: PER_PAGE_NUMBER}
github_options[:oauth_token] = @github_token unless @github_token.nil?
github_options[:endpoint] = options[:github_endpoint] unless options[:github_endpoint].nil?
github_options[:site] = options[:github_endpoint] unless options[:github_site].nil?

@github = Github.new github_options

@generator = Generator.new(@options)

Expand DownExpand Up@@ -276,8 +276,10 @@ def delete_by_time(array, hash_key, newer_tag_time, older_tag_time = nil)
# @return [String]
def create_log(pull_requests, issues, tag_name, tag_time)

github_site = options[:github_site] || 'https://github.com'

# Generate tag name and link
log = "## [#{tag_name}] (https://github.com/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n"
log = "## [#{tag_name}] (#{github_site}/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n"

#Generate date string:
time_string = tag_time.strftime @options[:format]
Expand Down
9 changes: 8 additions & 1 deletionlib/github_changelog_generator/parser.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,6 +46,12 @@ def self.parse_options
opts.on('--labels-pr x,y,z', Array, 'Only pull requests with specified labels will be included to changelog. Default is nil') do |list|
options[:pull_request_labels] = list
end
opts.on('--github-site [URL]', 'The Enterprise Github site on which your project is hosted.') do |last|
options[:github_site] = last
end
opts.on('--github-api [URL]', 'The enterprise endpoint to use for your Github API.') do |last|
options[:github_endpoint] = last
end
opts.on('-v', '--version', 'Print version number') do |v|
puts "Version: #{GitHubChangelogGenerator::VERSION}"
exit
Expand All@@ -59,8 +65,9 @@ def self.parse_options
parser.parse!

if ARGV[0] && !ARGV[1]
github_site = options[:github_site] ? options[:github_site] : 'github.com'
# this match should parse https://github.com/skywinder/Github-Changelog-Generator and skywinder/Github-Changelog-Generator to user and name
match = /(?:.+github\.com\/)?(.+)\/(.+)/.match(ARGV[0])
match = /(?:.+#{Regexp.escape(github_site)}\/)?(.+)\/(.+)/.match(ARGV[0])

if match[2].nil?
exit
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp