Fix missed sub-section headers and add documentation

This commit is contained in:
Petr Korolev 2015-03-27 17:06:09 +02:00
parent c8584a1749
commit ae0d1d16de

View File

@ -447,22 +447,26 @@ module GitHubChangelogGenerator
end end
} }
log += generate_log_from_array(enhancement_a, @options[:enhancement_prefix]) log += generate_sub_section(enhancement_a, @options[:enhancement_prefix])
log += generate_log_from_array(bugs_a, @options[:bug_prefix]) log += generate_sub_section(bugs_a, @options[:bug_prefix])
log += generate_log_from_array(issues_a, @options[:issue_prefix]) log += generate_sub_section(issues_a, @options[:issue_prefix])
end end
if @options[:pulls] if @options[:pulls]
# Generate pull requests: # Generate pull requests:
log += generate_log_from_array(pull_requests, @options[:merge_prefix]) log += generate_sub_section(pull_requests, @options[:merge_prefix])
end end
log log
end end
def generate_log_from_array(issues, prefix) # @param [Array] issues List of issues on sub-section
# @param [String] prefix Nae of sub-section
# @return [String] Generate ready-to-go sub-section
def generate_sub_section(issues, prefix)
log = '' log = ''
if options[:simple_list].nil? && issues.any?
if options[:simple_list] != true && issues.any?
log += "#{prefix}\n\n" log += "#{prefix}\n\n"
end end