Module: Octokit

Defined in:
lib/unwrappr/octokit.rb

Overview

Wrapper around octokit

Class Method Summary collapse

Class Method Details

.access_token_from_environmentObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/unwrappr/octokit.rb', line 9

def self.access_token_from_environment
  ENV.fetch('GITHUB_TOKEN') do
    raise <<~MESSAGE
      Missing environment variable GITHUB_TOKEN.
      See https://github.com/settings/tokens to set up personal access tokens.
      Add to the environment:

          export GITHUB_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    MESSAGE
  end
end

.clientObject



5
6
7
# File 'lib/unwrappr/octokit.rb', line 5

def self.client
  @client ||= Client.new(access_token: access_token_from_environment)
end