Skip to content

Instantly share code, notes, and snippets.

@volontarian
Forked from ryanb/railscasts_episodes.rb
Last active December 13, 2015 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save volontarian/4978183 to your computer and use it in GitHub Desktop.
Save volontarian/4978183 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'octokit' # gem install octokit
page = 1
catch(:done) do
while (repositories = Octokit.repositories('railscasts', page: page, per_page: 100, sort: 'created', direction: 'desc')).length > 0
repositories.each do |repository|
throw :done if File.exist? repository.name
system "git clone git://github.com/railscasts/#{repository.name}"
end
page += 1
end
end
puts "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment