From 606fab42898940072ad40a5260e3d9ad32c28be5 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Fri, 7 Nov 2014 18:14:26 +0200 Subject: [PATCH] update Text for issues. (depends of what label placed) --- lib/github_changelog_generator.rb | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 358a959..4ed93e6 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -233,7 +233,27 @@ class ChangelogGenerator # Generate issues: if issues issues.each { |dict| - merge = "*Fixed issue:* #{dict[:title]} [\\##{dict[:number]}](https://github.com/#{@options[:user]}/#{@options[:project]}/issues/#{dict[:number]})\n\n" + is_bug = false + is_enchantment = false + dict.labels.each { |label| + if label.name == 'bug' + is_bug = true + end + if label.name == 'enchantment' + is_enchantment = true + end + } + + intro = 'Fixed issue' + if is_bug + intro = 'Fixed bug' + end + + if is_enchantment + intro = 'Implemented enchantment' + end + + merge = "*#{intro}:* #{dict[:title]} [\\##{dict[:number]}](https://github.com/#{@options[:user]}/#{@options[:project]}/issues/#{dict[:number]})\n\n" log += "- #{merge}" } end