Module: Chairman

Defined in:
lib/version.rb,
lib/chairman.rb,
lib/chairman/holmes.rb,
lib/chairman/routes.rb

Defined Under Namespace

Modules: Holmes Classes: Routes

Constant Summary collapse

VERSION =
"0.4"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.client_idObject (readonly)

Returns the value of attribute client_id.



13
14
15
# File 'lib/chairman.rb', line 13

def client_id
  @client_id
end

.client_secretObject (readonly)

Returns the value of attribute client_secret.



13
14
15
# File 'lib/chairman.rb', line 13

def client_secret
  @client_secret
end

.scopeObject (readonly)

Returns the value of attribute scope.



13
14
15
# File 'lib/chairman.rb', line 13

def scope
  @scope
end

.session(auth_token = nil) ⇒ Object (readonly)

Returns the value of attribute session.



13
14
15
# File 'lib/chairman.rb', line 13

def session
  @session
end

Class Method Details

.config(client_id, client_secret, scope) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/chairman.rb', line 15

def config(client_id, client_secret, scope)
  memcache_host = ENV['MEMCACHIER_SERVERS'] || ENV['MEMCACHED_URL'] || 'localhost:11211'

  stack = Faraday::RackBuilder.new do |builder|
    builder.use Faraday::HttpCache, shared_cache: false, logger: Logger.new(STDOUT), store: :mem_cache_store, store_options: [memcache_host], serializer: Oj
    builder.adapter Faraday.default_adapter
  end
  Octokit.middleware = stack

  @client_id = client_id
  @client_secret = client_secret
  @scope = scope
end