vendredi 6 février 2015

Getting lists of filenames attached to pull requests


Vote count:

0




I have this code:



require 'octokit'
require 'csv'

client = Octokit::Client.new :login => 'username', :password => 'password'
repo = 'django/django'
numbers = CSV.read('django_c1.csv').flatten

CSV.open('django_c1_stats.csv', 'w') do |csv|
csv << ["pull.number", "pull.additions", "pull.deletions", "pull.created_at", "pull.merged_at", "pull.commits", "pull.changed_files", "names_of_files_changed"]
for number in numbers
begin
pull = client.pull_request(repo, number)
files = client.pull_files(repo, number)
csv << [pull.number, pull.additions, pull.deletions, pull.created_at, pull.merged_at, pull.commits, pull.changed_files, files]
rescue
csv << [number, 0, 0, 0, 0, 0, 0, 0]
next
end
end
end


However, it gives me a large hashie for the client.pull_files(repo, number) request. I want to subset and get a list of only the filenames of the files that are changed by the pull request. How can I accomplish this?



asked 23 secs ago







Getting lists of filenames attached to pull requests

Aucun commentaire:

Enregistrer un commentaire