From b0be9f8b0617dce1887a79718d2a6242e594091c Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Mar 2015 09:37:29 +0200 Subject: [PATCH 1/3] Fix termination in case of empty unreleased section with `--unreleased-only` option. --- lib/github_changelog_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 9f768aa..cffe8d7 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -332,7 +332,7 @@ module GitHubChangelogGenerator if filtered_issues.empty? && filtered_pull_requests.empty? && newer_tag.nil? # do not generate empty unreleased section - return nil + return '' end self.create_log(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name) From a4f93feb7d9119a865556b73bc111da6bd0dc74a Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Mar 2015 10:18:58 +0200 Subject: [PATCH 2/3] This commit fix #69. --- lib/github_changelog_generator.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index cffe8d7..55c0c85 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -36,7 +36,6 @@ module GitHubChangelogGenerator if @options[:pulls] @pull_requests = self.get_filtered_pull_requests - self.fetch_merged_at_pull_requests else @pull_requests = [] end @@ -138,12 +137,12 @@ module GitHubChangelogGenerator def get_filtered_pull_requests - pull_requests = @pull_requests - filtered_pull_requests = pull_requests + self.fetch_merged_at_pull_requests + filtered_pull_requests = @pull_requests.select {|pr| pr[:merged_at] != nil } unless @options[:include_labels].nil? - filtered_pull_requests = pull_requests.select { |issue| + filtered_pull_requests = @pull_requests.select { |issue| #add all labels from @options[:incluse_labels] array (issue.labels.map { |label| label.name } & @options[:include_labels]).any? } @@ -157,7 +156,7 @@ module GitHubChangelogGenerator end if @options[:add_issues_wo_labels] - issues_wo_labels = pull_requests.select { + issues_wo_labels = @pull_requests.select { # add issues without any labels |issue| !issue.labels.map { |label| label.name }.any? } From 3cc64180484ba4a8a6d1559f1401f9bc66f2c467 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Mar 2015 10:27:29 +0200 Subject: [PATCH 3/3] Update gemspec to version 1.3.10 --- lib/github_changelog_generator/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github_changelog_generator/version.rb b/lib/github_changelog_generator/version.rb index 03dd626..d419d95 100644 --- a/lib/github_changelog_generator/version.rb +++ b/lib/github_changelog_generator/version.rb @@ -1,3 +1,3 @@ module GitHubChangelogGenerator - VERSION = '1.3.9' + VERSION = '1.3.10' end