Skip to content

Instantly share code, notes, and snippets.

@cao7113
Forked from volontarian/railscasts_episodes.rb
Created March 4, 2013 03:17
Show Gist options
  • Save cao7113/5079659 to your computer and use it in GitHub Desktop.
Save cao7113/5079659 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, sorted: '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