Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'octokit'
- require 'fileutils'
- puts "Give me your github username!"
- print "> " ; username = STDIN.gets.chomp
- puts "Give me your account password!"
- print "> " ; password = STDIN.gets.chomp
- api = Octokit::Client.new(:login => username, :password => password)
- repos = Octokit.search_repositories("dotfiles")
- repos.each do |repo|
- puts repo.url
- system "git clone #{repo.url}"
- if File.exist? "#{repo.name}/vimrc"
- vimrc = File.open("#{repo.name}/vimrc", "r")
- content = vimrc.read
- vimrc.close
- if content.include? "set expandtab"
- vimrc = File.open("#{repo.name}/vimrc", "w")
- content = content.gsub('set expandtab', '')
- vimrc.truncate(vimrc.size)
- vimrc.write(content)
- vimrc.close
- Dir.chdir "#{repo.name}"
- system "git commit -am 'Y U NO USE TABS?!'"
- api.fork("#{repo.username}/#{repo.name}")
- system "git remote add penis git@github.com:#{username}/#{repo.name}.git"
- system "git push -u penis master"
- api.create_pull_request("#{repo.username}/#{repo.name}", "master", "#{username}:master", "You are still using spaces", "According to your .vimrc you are still using spaces. I removed the 'set expandtab' option from your .vimrc so now you can use tabs again :3")
- api.delete_repo("#{username}/#{repo.name}")
- Dir.chdir ".."
- end
- end
- FileUtils.rm_rf(repo.name)
- end
Add Comment
Please, Sign In to add comment