From 808155ee3afcad55dd70f7959e4d404f1e2a0b5c Mon Sep 17 00:00:00 2001 From: tuexss Date: Thu, 26 Mar 2015 23:03:49 +0100 Subject: [PATCH] Slim down newer_tag initialization --- lib/github_changelog_generator.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 733d18e..3cee278 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -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)