code cleanup

This commit is contained in:
Petr Korolev 2014-11-19 12:43:55 +02:00
parent a4e9390283
commit 062f3fd3f2

View File

@ -45,6 +45,11 @@ module GitHubChangelogGenerator
def get_all_closed_pull_requests def get_all_closed_pull_requests
if @options[:verbose]
puts 'Fetching pull requests..'
end
response = @github.pull_requests.list @options[:user], @options[:project], :state => 'closed' response = @github.pull_requests.list @options[:user], @options[:project], :state => 'closed'
pull_requests = [] pull_requests = []
@ -53,7 +58,7 @@ module GitHubChangelogGenerator
end end
if @options[:verbose] if @options[:verbose]
puts "Receive all pull requests: #{pull_requests.count}" puts "Received all closed pull requests: #{pull_requests.count}"
end end
pull_requests pull_requests
@ -132,11 +137,8 @@ module GitHubChangelogGenerator
def get_all_tags def get_all_tags
url = "https://api.github.com/repos/#{@options[:user]}/#{@options[:project]}/tags"
if @options[:verbose] if @options[:verbose]
puts 'Fetching all tags..'
puts "Receive tags for repo #{url}"
end end
response = @github.repos.tags @options[:user], @options[:project] response = @github.repos.tags @options[:user], @options[:project]
@ -334,6 +336,11 @@ module GitHubChangelogGenerator
end end
def get_all_issues def get_all_issues
if @options[:verbose]
puts 'Fetching closed issues..'
end
response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil
@ -348,7 +355,7 @@ module GitHubChangelogGenerator
} }
if @options[:verbose] if @options[:verbose]
puts "Receive all closed issues: #{issues.count}" puts "Received closed issues: #{issues.count}"
end end
filtered_issues = issues.select { |issue| filtered_issues = issues.select { |issue|