Assume I have a list of pull request IDs, such as in this gist.
If I simply want to have two variables for each ID: "lines added" and "lines deleted". How can I use octokit to get these variables for each pull request?
I'd imagine I'd start like this in ruby:
require 'octokit'
require 'csv'
list = [2825, 2119, 2629]
output = []
for id in list
output.push(Octokit.pull_request('rubinius/rubinius', id, options = {}))
end
begin
file = File.open("/Users/Username/Desktop/pr_mining_output.txt", "w")
file.write(output)
rescue IOError => e
#some error occur, dir not writable etc.
ensure
file.close unless file == nil
end
But this seems to simply overwrite the file and just give me one result instead of 3 (or however many are in the list
object. How can I make it give me the data for all 3?