lib/github_changelog_generator/octo_fetcher.rb
def fetch_closed_issues_and_pr
      print "Fetching closed issues...\r" if @options[:verbose]
      issues = []
      options = {
        state: "closed",
        filter: "all",
        labels: nil
      }
      options[:since] = @since unless @since.nil?

      page_i      = 0
      count_pages = calculate_pages(@client, "issues", options)

      iterate_pages(@client, "issues", options) do |new_issues|
        page_i += PER_PAGE_NUMBER
        print_in_same_line("Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}")
        issues.concat(new_issues)
        break if @options[:max_issues] && issues.length >= @options[:max_issues]
      end
      print_empty_line
      Helper.log.info "Received issues: #{issues.count}"

      issues = issues.map { |h| stringify_keys_deep(h.to_hash) }

      # separate arrays of issues and pull requests:
      issues.partition do |x|
        x["pull_request"].nil?
      end
    end
# This method fetch all closed issues and separate them to pull requests and pure issues
# (pull request is kind of issue in term of GitHub)
#
# @return [Tuple] with (issues [Array <Hash>], pull-requests [Array <Hash>])
This method fetch all closed issues and separate them to pull requests and pure issues
(pull request is kind of issue in term of GitHub)
This method fetch all closed issues and separate them to pull requests and pure issues ( pull request is kind of issue in term of GitHub )
def fetch_closed_issues_and_pr
      print "Fetching closed issues...\r" if @options[:verbose]
      issues = []
      options = {
        state: "closed",
        filter: "all",
        labels: nil
      }
      options[:since] = @since unless @since.nil?
      page_i      = 0
      count_pages = calculate_pages(@client, "issues", options)
      iterate_pages(@client, "issues", options) do |new_issues|
        page_i += PER_PAGE_NUMBER
        print_in_same_line("Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}")
        issues.concat(new_issues)
        break if @options[:max_issues] && issues.length >= @options[:max_issues]
      end
      print_empty_line
      Helper.log.info "Received issues: #{issues.count}"
      issues = issues.map { |h| stringify_keys_deep(h.to_hash) }
      issues.partition do |x|
        x["pull_request"].nil?
      end
    end
def fetch_closed_issues_and_pr print "Fetching closed issues...\r" if @options [ :verbose ] issues = [ ] options = { state : "closed" , filter : "all" , labels : nil } options [ :since ] = @since unless @since . nil? page_i = 0 count_pages = calculate_pages ( @client , "issues" , options ) iterate_pages ( @client , "issues" , options ) do | new_issues | page_i += PER_PAGE_NUMBER print_in_same_line ( "Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}" ) issues . concat ( new_issues ) break if @options [ :max_issues ] && issues . length >= @options [ :max_issues ] end print_empty_line Helper . log . info "Received issues: #{issues.count}" issues = issues . map { | h | stringify_keys_deep ( h . to_hash ) } issues . partition do | x | x [ "pull_request" ] . nil? end end
This method fetch all closed issues and separate them to pull requests and pure issues
(pull request is kind of issue in term of GitHub)
This method fetch all closed issues and separate them to pull requests and pure issues ( pull request is kind of issue in term of GitHub )
# separate arrays of issues and pull requests:
with (issues [Array ], pull-requests [Array ])
with ( issues [ Array ] pull - requests [ Array ] )
Tuple