Slim down newer_tag initialization

This commit is contained in:
tuexss 2015-03-26 23:03:49 +01:00
parent d80a6803be
commit 808155ee3a

View File

@ -410,20 +410,13 @@ module GitHubChangelogGenerator
# @param [String] older_tag_name
# @return [String]
def create_log(pull_requests, issues, newer_tag, older_tag_name = nil)
newer_tag_time = newer_tag.nil? ? nil : get_time_of_tag(newer_tag)
newer_tag_name = newer_tag.nil? ? nil : newer_tag['name']
newer_tag_time = newer_tag.nil? ? Time.new : get_time_of_tag(newer_tag)
newer_tag_name = newer_tag.nil? ? @options[:unreleased_label] : newer_tag['name']
newer_tag_link = newer_tag.nil? ? 'HEAD' : newer_tag_name
github_site = options[:github_site] || 'https://github.com'
project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}"
if newer_tag.nil?
newer_tag_name = @options[:unreleased_label]
newer_tag_link = 'HEAD'
newer_tag_time = Time.new
else
newer_tag_link = newer_tag_name
end
log = ''
log += generate_header(log, newer_tag_name, newer_tag_link, newer_tag_time, older_tag_name, project_url)