Module: March::Github

Defined in:
lib/march/client.rb

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Class Method Details

.clientObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/march/client.rb', line 22

def self.client
  return @client if @client

  Octokit.api_endpoint = ENV['GITHUB_API'] if ENV['GITHUB_API']
  opts = { :access_token => ENV.fetch('GITHUB_TOKEN') }
  @client = Octokit::Client.new(opts)
  verify = 
    case ENV['VERIFY_SSL'] || 'true'
    when 'false', 'no' then false
    else true
    end

  @client.connection_options[:ssl] = { verify: verify }

  @client
end

.configurationObject



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

def self.configuration
  Configuration.instance
end

.configure {|configuration| ... } ⇒ Object

Yields:



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

def self.configure
  yield(configuration) if block_given?
end