Module: GitHub

Includes:
Contracts
Defined in:
lib/git-ready/github.rb

Class Method Summary collapse

Class Method Details

.apiObject



20
21
22
# File 'lib/git-ready/github.rb', line 20

def self.api
  @api ||= Octokit::Client.new access_token: Settings.github_access_token, auto_paginate: true
end

.fork_all(organization) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/git-ready/github.rb', line 10

def self.fork_all(organization)
  repositories = api.org_repos organization
  progress = ProgressBar.new repositories.length
  repositories.flat_map do |repository|
    progress.increment!
    { upstream: repository, origin: api.fork(repository[:full_name]) }
  end
end