From 433d46d85b25df466fac5735c53fe25239fd9b83 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 15 Dec 2014 15:34:20 +0200 Subject: [PATCH 1/2] fx --- lib/github_changelog_generator.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index a819606..3e6c118 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -356,7 +356,7 @@ module GitHubChangelogGenerator def get_all_issues if @options[:verbose] - puts "Fetching closed issues...\r" + print "Fetching closed issues...\r" end response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil @@ -366,7 +366,6 @@ module GitHubChangelogGenerator response.each_page do |page| print "Fetching closed issues... #{page_i}\r" page_i += PER_PAGE_NUMBER - pull_requests.concat(page) issues.concat(page) end From a44b0bdd25e2c270e3f8eb5807656097ac5c9bf9 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 15 Dec 2014 15:53:02 +0200 Subject: [PATCH 2/2] fix pagination issue + verboose. back to 30 per-pages --- lib/github_changelog_generator.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 3e6c118..133c83d 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -14,7 +14,7 @@ module GitHubChangelogGenerator attr_accessor :options, :all_tags, :github - PER_PAGE_NUMBER = 100 + PER_PAGE_NUMBER = 30 def initialize @@ -380,6 +380,11 @@ module GitHubChangelogGenerator puts "Received closed issues: #{issues.count}" end + + if @options[:verbose] + puts "Filtering issues with labels #{@options[:labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}" + end + filtered_issues = issues.select { |issue| #compare is there any labels from @options[:labels] array (issue.labels.map { |label| label.name } & @options[:labels]).any? @@ -394,7 +399,7 @@ module GitHubChangelogGenerator end if @options[:verbose] - puts "Filter issues with labels #{@options[:labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count} issues" + puts "Filtered issues: #{filtered_issues.count}" end filtered_issues