lib/github_changelog_generator/octo_fetcher.rb
def iterate_pages(client, method, *args)
      request_opts = extract_request_args(args)
      args.push(@request_options.merge(request_opts))

      number_of_pages = 1

      check_github_response { client.send(method, user_project, *args) }
      last_response = client.last_response
      if last_response.status == 301
        raise MovedPermanentlyError, last_response.data[:url]
      end

      yield(last_response.data)

      until (next_one = last_response.rels[:next]).nil?
        number_of_pages += 1

        last_response = check_github_response { next_one.get }
        yield(last_response.data)
      end

      number_of_pages
    end
# Iterates through all pages until there are no more :next pages to follow
# yields the result per page
#
# @param [Octokit::Client] client
# @param [String] method (eg. 'tags')
#
# @yield [Sawyer::Resource] An OctoKit-provided response (which can be empty)
#
# @return [Integer] total number of pages
Iterates through all pages until there are no more :next pages to follow
yields the result per page
Iterates through all pages until there are no more : next pages to follow yields the result per page
def iterate_pages(client, method, *args)
      request_opts = extract_request_args(args)
      args.push(@request_options.merge(request_opts))
      number_of_pages = 1
      check_github_response { client.send(method, user_project, *args) }
      last_response = client.last_response
      if last_response.status == 301
        raise MovedPermanentlyError, last_response.data[:url]
      end
      yield(last_response.data)
      until (next_one = last_response.rels[:next]).nil?
        number_of_pages += 1
        last_response = check_github_response { next_one.get }
        yield(last_response.data)
      end
      number_of_pages
    end
def iterate_pages ( client , method , * args ) request_opts = extract_request_args ( args ) args . push ( @request_options . merge ( request_opts ) ) number_of_pages = 1 check_github_response { client . send ( method , user_project , * args ) } last_response = client . last_response if last_response . status == 301 raise MovedPermanentlyError , last_response . data [ :url ] end yield ( last_response . data ) until ( next_one = last_response . rels [ :next ] ) . nil? number_of_pages += 1 last_response = check_github_response { next_one . get } yield ( last_response . data ) end number_of_pages end
Iterates through all pages until there are no more :next pages to follow
yields the result per page
Iterates through all pages until there are no more : next pages to follow yields the result per page
total number of pages
total number of pages
Integer
client
method
args
None
]
An OctoKit-provided response (which can be empty)
An OctoKit - provided response ( which can be empty )