class Alvid::Github

Attributes

client[R]

Public Class Methods

new(api_endpoint, access_token) click to toggle source
# File lib/alvid/github.rb, line 7
def initialize(api_endpoint, access_token)
  Octokit.configure do |c|
      c.api_endpoint = api_endpoint
  end

  @client = Octokit::Client.new(access_token: access_token)
end

Public Instance Methods

create_repository(repo_name, organization) click to toggle source
# File lib/alvid/github.rb, line 16
def create_repository(repo_name, organization)
  @client.create_repository(repo_name, {:organization=>organization})
  keypair = Alvid::Keypair.new
  @client.add_deploy_key( "#{organization}/#{repo_name}" , "#{repo_name}-dk", keypair.pub)
  keypair.pri
end