Created
April 10, 2012 07:02
-
-
Save coderanger/2348932 to your computer and use it in GitHub Desktop.
Clean up after Gemnasium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
c = Octokit::Client.new(:login => "...", :password => "...") | |
conn = c.instance_exec{connection} | |
c.repos.each do |r| | |
puts "Trying to unsub #{r.name}" | |
begin | |
conn.get("/repos/#{c.login}/#{r.name}/hooks").body.each do |hook| | |
if hook.name == 'gemnasium' | |
conn.delete "/repos/#{c.login}/#{r.name}/hooks/#{hook.id}" | |
end | |
end | |
rescue SignalException => e | |
raise e | |
rescue Exception => e | |
puts "Error: #{e.to_s}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment