Prettify output

This commit is contained in:
Petr Korolev 2015-02-13 15:17:46 +02:00
parent f668aedafc
commit e6f12421ff

View File

@ -67,10 +67,11 @@ module GitHubChangelogGenerator
page_i = 0 page_i = 0
response.each_page do |page| response.each_page do |page|
page_i += PER_PAGE_NUMBER page_i += PER_PAGE_NUMBER
print "Fetching pull requests... #{page_i}\r" count_pages = response.count_pages
print "Fetching pull requests... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
pull_requests.concat(page) pull_requests.concat(page)
end end
print "\r" print " \r"
if @options[:verbose] if @options[:verbose]
puts "Received closed pull requests: #{pull_requests.count}" puts "Received closed pull requests: #{pull_requests.count}"
@ -203,12 +204,13 @@ module GitHubChangelogGenerator
tags = [] tags = []
page_i = 0 page_i = 0
count_pages = response.count_pages
response.each_page do |page| response.each_page do |page|
page_i += PER_PAGE_NUMBER page_i += PER_PAGE_NUMBER
print "Fetching tags... #{page_i}\r" print "Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
tags.concat(page) tags.concat(page)
end end
print "\r" print " \r"
if @options[:verbose] if @options[:verbose]
puts "Found #{tags.count} tags" puts "Found #{tags.count} tags"
end end
@ -421,13 +423,18 @@ module GitHubChangelogGenerator
issues = [] issues = []
page_i = 0 page_i = 0
count_pages = response.count_pages
response.each_page do |page| response.each_page do |page|
page_i += PER_PAGE_NUMBER page_i += PER_PAGE_NUMBER
print "Fetching closed issues... #{page_i}\r" print "Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
issues.concat(page) issues.concat(page)
end end
#
print "\r" # print " \r"
#
# # if @options[:verbose]
# puts "Received issues...: #{issues.count}"
# end
# remove pull request from issues: # remove pull request from issues:
issues.select! { |x| issues.select! { |x|