@@ -141,11 +141,10 @@ The loop will finish when there is no `rels[:next]` information to consume (in o
141141words, we are at` rels[:last] ` ). It might look something like this:
142142
143143#!ruby
144- loop do
145- puts last_response.data.items.first.path
144+ puts last_response.data.items.first.path
145+ until last_response.rels[:next].nil?
146146 last_response = last_response.rels[:next].get
147- sleep 4 # back off from the API rate limiting; don't do this in Real Life
148- break if last_response.rels[:next].nil?
147+ puts last_response.data.items.first.path
149148end
150149
151150Changing the number of items per page is extremely simple with Octokit.rb. Simply
@@ -170,11 +169,10 @@ your code should remain intact:
170169
171170puts "And here's the first path for every set"
172171
173- loop do
174- puts last_response.data.items.first.path
172+ puts last_response.data.items.first.path
173+ until last_response.rels[:next].nil?
175174 last_response = last_response.rels[:next].get
176- sleep 4 # back off from the API rate limiting; don't do this in Real Life
177- break if last_response.rels[:next].nil?
175+ puts last_response.data.items.first.path
178176end
179177
180178##Constructing Pagination Links