Skip to content

Instantly share code, notes, and snippets.

@gabrieljoelc
Last active January 5, 2016 21:57
Show Gist options
  • Save gabrieljoelc/43611186ceba7749754b to your computer and use it in GitHub Desktop.
Save gabrieljoelc/43611186ceba7749754b to your computer and use it in GitHub Desktop.
require 'csv'
require 'gems'
CSV.open("#{ENV['HOME']}/Documents/gems_and_metadata.csv", 'wb') do |csv|
gems = CSV.foreach("#{ENV['HOME']}/Documents/gems.csv") do |row|
new_row = row.concat([nil, nil])
begin
info = Gems.info(row.first)
new_row[new_row.size - 2] = info['authors']
new_row[new_row.size - 1] = info['homepage_uri']
rescue
ensure
puts new_row.join(',')
csv << new_row
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment