pretify logs

This commit is contained in:
Petr Korolev 2014-11-05 13:55:02 +02:00
parent 91e14703f1
commit cd2f14be0f

View File

@ -53,10 +53,12 @@ class LogGenerator
issues = @github.pull_requests.list $github_user, $github_repo_name, :state => 'closed' issues = @github.pull_requests.list $github_user, $github_repo_name, :state => 'closed'
json = issues.body json = issues.body
if @options[:verbose]
puts 'All pull requests:'
json.each { |dict| json.each { |dict|
# print_json dict p "##{dict[:number]} - #{dict[:title]} (#{dict[:closed_at]})"
# puts "##{dict[:number]} - #{dict[:title]} (#{dict[:closed_at]})"
} }
end
json json
@ -86,12 +88,12 @@ class LogGenerator
def get_all_merged_pull_requests def get_all_merged_pull_requests
json = self.get_all_closed_pull_requests json = self.get_all_closed_pull_requests
puts 'Check if the requests is merged' puts 'Check if the requests is merged... (it can take a while)'
json.delete_if { |req| json.delete_if { |req|
merged = self.is_megred(req[:number]) merged = self.is_megred(req[:number])
if @options[:verbose] if @options[:verbose]
puts "##{req[:number]} merged #{merged}" puts "##{req[:number]} #{merged ? 'merged' : 'not merged'}"
end end
!merged !merged
} }
@ -108,9 +110,4 @@ if __FILE__ == $0
json = log_generator.get_all_merged_pull_requests json = log_generator.get_all_merged_pull_requests
p json.count p json.count
# json.each { |dict|
# # print_json dict
# p "##{dict[:number]} - #{dict[:title]} (#{dict[:closed_at]})"
# }
end end