Module: GithubService
- Defined in:
- lib/github_service.rb
Instance Method Summary collapse
- #gh_create_push_hook(repo_name, url) ⇒ Object
- #gh_create_wiki_update_hook(repo_name, url) ⇒ Object
- #gh_login ⇒ Object
- #gh_member_of?(team_name) ⇒ Boolean
- #gh_owner? ⇒ Boolean
- #gh_repositories ⇒ Object
- #gh_repository(repo_name) ⇒ Object
- #gh_teams ⇒ Object
- #github ⇒ Object
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_login ⇒ Object
18 19 20 |
# File 'lib/github_service.rb', line 18 def gh_login github.user.login end |
#gh_member_of?(team_name) ⇒ 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), gh_login) end |
#gh_owner? ⇒ Boolean
22 23 24 |
# File 'lib/github_service.rb', line 22 def gh_owner? gh_member_of?('Owners') end |
#gh_repositories ⇒ Object
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_teams ⇒ Object
10 11 12 |
# File 'lib/github_service.rb', line 10 def gh_teams github.org_teams(organisation_name) end |
#github ⇒ Object
2 3 4 |
# File 'lib/github_service.rb', line 2 def github Octokit::Client.new access_token: session[:auth_token] end |