Created
February 13, 2014 13:00
-
-
Save sferik/8974658 to your computer and use it in GitHub Desktop.
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 'gems' | |
require 'nokogiri' | |
require 'octokit' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('https://rubygems.org/profiles/45069')) | |
repo_names = doc.search('.profile-list ol li a.profile-rubygem').map do |element| | |
gem = Gems.info(element.text.split(/\s+/)[1]) | |
gem['info'].match('kicks the ass') && gem['homepage_uri'].match(%r{github\.com/ahoward/(\w*)})[1] | |
end.compact | |
repo_names.each do |name| | |
%x(git clone https://github.com/ahoward/#{name}.git) | |
repo = Octokit.repo("ahoward/#{name}") | |
%x(sed -i '' -e "s/description: #{name} kicks the ass/#{repo.description.gsub('/', '\/')}/" #{name}/#{name}.gemspec) | |
%x(cd #{name}; hub fork; git checkout -b update_description; git commit -am 'Make gem description more descriptive'; git push -u sferik update_description) | |
Octokit.create_pull_request("ahoward/#{name}", 'ahoward:master', 'sferik:update_description', 'Update description', 'Make gem description more descriptive.') | |
end |
Like a boss!
So this is why my feed was filled with you forking systemu?
@bobthecow Sorry for the feed noise. It took a few tries to get the script working right and systemu
was the first repo returned by RubyGems.org.
This is hilarious.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hehe 😆