fix #251
This commit is contained in:
parent
4de98a7d16
commit
e274f9992a
|
@ -1,5 +1,5 @@
|
|||
# This configuration was generated by `rubocop --auto-gen-config`
|
||||
# on 2015-06-12 11:23:12 +0300 using RuboCop version 0.31.0.
|
||||
# on 2015-07-16 14:46:25 +0300 using RuboCop version 0.31.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
|
@ -7,7 +7,7 @@
|
|||
|
||||
# Offense count: 13
|
||||
Metrics/AbcSize:
|
||||
Max: 71
|
||||
Max: 73
|
||||
|
||||
# Offense count: 1
|
||||
Metrics/CyclomaticComplexity:
|
||||
|
|
|
@ -56,7 +56,7 @@ module GitHubChangelogGenerator
|
|||
# @param [String] newer_tag Name of the newer tag. Could be nil for `Unreleased` section
|
||||
# @param [String] older_tag_name Older tag, used for the links. Could be nil for last tag.
|
||||
# @return [String] Ready and parsed section
|
||||
def create_log(pull_requests, issues, newer_tag, older_tag_name = nil)
|
||||
def create_log_for_tag(pull_requests, issues, newer_tag, older_tag_name = nil)
|
||||
newer_tag_link, newer_tag_name, newer_tag_time = detect_link_tag_time(newer_tag)
|
||||
|
||||
github_site = options[:github_site] || "https://github.com"
|
||||
|
|
|
@ -8,7 +8,7 @@ module GitHubChangelogGenerator
|
|||
sort_tags_by_date(@filtered_tags)
|
||||
fetch_issues_and_pr
|
||||
|
||||
log = "# Change Log\n\n"
|
||||
log = "#{@options[:header]}\n\n"
|
||||
|
||||
if @options[:unreleased_only]
|
||||
log += generate_log_between_tags(filtered_tags[0], nil)
|
||||
|
@ -103,7 +103,7 @@ module GitHubChangelogGenerator
|
|||
return ""
|
||||
end
|
||||
|
||||
create_log(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name)
|
||||
create_log_for_tag(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name)
|
||||
end
|
||||
|
||||
# Apply all filters to issues and pull requests
|
||||
|
|
|
@ -59,6 +59,9 @@ module GitHubChangelogGenerator
|
|||
opts.on("--issues-label [LABEL]", "Setup custom label for closed-issues section. Default is \"**Closed issues:**\"") do |v|
|
||||
options[:issue_prefix] = v
|
||||
end
|
||||
opts.on("--header-label [LABEL]", "Setup custom header label. Default is \"# Change Log\"") do |v|
|
||||
options[:header] = v
|
||||
end
|
||||
opts.on("--pr-label [LABEL]", "Setup custom label for pull requests section. Default is \"**Merged pull requests:**\"") do |v|
|
||||
options[:merge_prefix] = v
|
||||
end
|
||||
|
@ -162,6 +165,7 @@ module GitHubChangelogGenerator
|
|||
max_issues: nil,
|
||||
simple_list: false,
|
||||
verbose: true,
|
||||
header: "# Change Log",
|
||||
merge_prefix: "**Merged pull requests:**",
|
||||
issue_prefix: "**Closed issues:**",
|
||||
bug_prefix: "**Fixed bugs:**",
|
||||
|
|
Loading…
Reference in New Issue
Block a user