Module: Lita::Extensions::GitHubWebHooksCore::Hooks::RepoHooks

Included in:
CommitComment, Create, Delete, Deployment, DeploymentStatus, Fork, Gollum, IssueComment, Issues, Member, PageBuild, Public, PullRequest, PullRequestReviewComment, Push, Release, Repository, Status, TeamAdd, Watch
Defined in:
lib/lita/extensions/github_web_hooks_core/hooks/repo_hooks.rb

Instance Method Summary collapse

Instance Method Details

#access_tokenObject



28
29
30
31
32
33
34
# File 'lib/lita/extensions/github_web_hooks_core/hooks/repo_hooks.rb', line 28

def access_token
  t = ENV["GITHUB_ACCESS_TOKEN"]
  if t.nil?
    raise ArgumentError.new("Configure your GitHub API use via the GITHUB_ACCESS_TOKEN env variable")
  end
  t
end

#clientObject



24
25
26
# File 'lib/lita/extensions/github_web_hooks_core/hooks/repo_hooks.rb', line 24

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

#repoObject



20
21
22
# File 'lib/lita/extensions/github_web_hooks_core/hooks/repo_hooks.rb', line 20

def repo
  repository["full_name"]
end

#repositoryObject



16
17
18
# File 'lib/lita/extensions/github_web_hooks_core/hooks/repo_hooks.rb', line 16

def repository
  payload["repository"]
end