OctoFetcher: drop unused number_of_pages feature (#568)
This commit is contained in:
parent
21ec2db39b
commit
74fdc2026a
|
@ -274,13 +274,11 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
|
||||||
#
|
#
|
||||||
# @yield [Sawyer::Resource] An OctoKit-provided response (which can be empty)
|
# @yield [Sawyer::Resource] An OctoKit-provided response (which can be empty)
|
||||||
#
|
#
|
||||||
# @return [Integer] total number of pages
|
# @return [void]
|
||||||
def iterate_pages(client, method, *args)
|
def iterate_pages(client, method, *args)
|
||||||
request_opts = extract_request_args(args)
|
request_opts = extract_request_args(args)
|
||||||
args.push(@request_options.merge(request_opts))
|
args.push(@request_options.merge(request_opts))
|
||||||
|
|
||||||
number_of_pages = 1
|
|
||||||
|
|
||||||
check_github_response { client.send(method, user_project, *args) }
|
check_github_response { client.send(method, user_project, *args) }
|
||||||
last_response = client.last_response
|
last_response = client.last_response
|
||||||
if last_response.status == 301
|
if last_response.status == 301
|
||||||
|
@ -290,13 +288,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
|
||||||
yield(last_response.data)
|
yield(last_response.data)
|
||||||
|
|
||||||
until (next_one = last_response.rels[:next]).nil?
|
until (next_one = last_response.rels[:next]).nil?
|
||||||
number_of_pages += 1
|
|
||||||
|
|
||||||
last_response = check_github_response { next_one.get }
|
last_response = check_github_response { next_one.get }
|
||||||
yield(last_response.data)
|
yield(last_response.data)
|
||||||
end
|
end
|
||||||
|
|
||||||
number_of_pages
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_request_args(args)
|
def extract_request_args(args)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user