Module: GithubService

Defined in:
lib/github_service.rb

Instance Method Summary collapse

Instance Method Details

#gh_create_push_hook(repo_name, url) ⇒ Object



34
35
36
# File 'lib/github_service.rb', line 34

def gh_create_push_hook(repo_name, url)
  gh_create_hook(repo_name, url, %w(push))
end

#gh_create_wiki_update_hook(repo_name, url) ⇒ Object



30
31
32
# File 'lib/github_service.rb', line 30

def gh_create_wiki_update_hook(repo_name, url)
  gh_create_hook(repo_name, url, %w(gollum))
end

#gh_loginObject



18
19
20
# File 'lib/github_service.rb', line 18

def 
  github.user.
end

#gh_member_of?(team_name) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/github_service.rb', line 14

def gh_member_of?(team_name)
  github.team_member?(gh_team_id(team_name), )
end

#gh_owner?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/github_service.rb', line 22

def gh_owner?
  gh_member_of?('Owners')
end

#gh_repositoriesObject



6
7
8
# File 'lib/github_service.rb', line 6

def gh_repositories
  github.org_repos(organisation_name)
end

#gh_repository(repo_name) ⇒ Object



26
27
28
# File 'lib/github_service.rb', line 26

def gh_repository(repo_name)
  github.repository(gh_repo_path(repo_name))
end

#gh_teamsObject



10
11
12
# File 'lib/github_service.rb', line 10

def gh_teams
  github.org_teams(organisation_name)
end

#githubObject



2
3
4
# File 'lib/github_service.rb', line 2

def github
  Octokit::Client.new access_token: session[:auth_token]
end