From f1d9c839c7c2a3b60ef73904244a8d15610eac98 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 3 Dec 2014 11:59:45 +0200 Subject: [PATCH] optimize script --- lib/github_changelog_generator.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index ffbb86b..77e0ed0 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -265,17 +265,16 @@ module GitHubChangelogGenerator if @options[:pulls] # Generate pull requests: if pull_requests - if @options[:author] + pull_requests.each { |dict| - merge = "#{@options[:merge_prefix]}#{dict[:title]} [\\##{dict[:number]}](#{dict.html_url}) ([#{dict.user.login}](#{dict.user.html_url}))\n\n" + merge = "#{@options[:merge_prefix]}#{dict[:title]} [\\##{dict[:number]}](#{dict.html_url})" + if @options[:author] + merge += " ([#{dict.user.login}](#{dict.user.html_url}))\n\n" + else + merge += "\n\n" + end log += "- #{merge}" } - else - pull_requests.each { |dict| - merge = "#{@options[:merge_prefix]}#{dict[:title]} [\\##{dict[:number]}](#{dict.html_url})\n\n" - log += "- #{merge}" - } - end end end