class GemBootstrap::GitHubHelper

@api private

Public Class Methods

new() click to toggle source
# File lib/gem-bootstrap/github_helper.rb, line 9
def initialize
  @octokit = Octokit::Client.new(octokit_creds)
end

Public Instance Methods

create_repo(name:, description:, homepage:) click to toggle source
# File lib/gem-bootstrap/github_helper.rb, line 13
def create_repo(name:, description:, homepage:)
  @octokit.create_repository(
    name,
    description: description,
    homepage: homepage,
    private: false,
    has_issues: true,
    has_wiki: true,
    has_downloads: true,
    organization: nil,
    team_id: nil,
    auto_init: false,
    gitignore_template: nil
  )
end
github_username() click to toggle source
# File lib/gem-bootstrap/github_helper.rb, line 29
def github_username
  @octokit.user[:login]
end

Private Instance Methods

octokit_creds() click to toggle source
# File lib/gem-bootstrap/github_helper.rb, line 35
def octokit_creds
  if ENV['GITHUB_ACCESS_TOKEN']
    { access_token: ENV['GITHUB_ACCESS_TOKEN'] }
  else
    { netrc: true }
  end
end