omniauth-gitcafe-oauth2 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e5d6af14825e7cb8410cd1fc5d8d4ec17be7ff3
4
- data.tar.gz: 8a3541106e9af94ce5f714f314ab31ba0f385eae
3
+ metadata.gz: 01b5fa9c0e27b325258c68586dbcf02eb903b80a
4
+ data.tar.gz: 21145d84c63ebf04194f5aa1d6e1b1a37b22ec12
5
5
  SHA512:
6
- metadata.gz: 793653aa7c38a014ddc386bb619f9afc0cc25c92ba8d98e4093e74dea0772396fc3a87a60260b31fd4494076882e4ab86d03d25191c1541562f7e02ea96ac045
7
- data.tar.gz: eb6c4d43f47de022818e7138fb761f423dd7c4e4266953f07a9a74399075bdb1e692bc5a2d41a82c78e457db93dbca03ab428d69eac8f999a61196f739c01709
6
+ metadata.gz: 9d065e639b74e6e9cba6ab4ac24532c0d94953802cd0c90b52d74589b782d265928dec49823c27dc82343275e4e60a0a150b1d7a1b58ae38fdf411131b6b1a0c
7
+ data.tar.gz: b2a2aa4e67f244781701b05e2cc6d50fd37b1b9af38db06a2c36942cd2ca2b98a176116e41f3b4927d3b3c8fe82c99242c6498c31913b7ef2aed062c27b842b5
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GitCafeOauth2
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -3,8 +3,21 @@ require "omniauth-oauth2"
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class GitCafe < OmniAuth::Strategies::OAuth2
6
+ def self.config
7
+ @config ||= {}
8
+
9
+ if block_given?
10
+ yield(@config)
11
+ option :client_options, {site: @config[:site_url]}
12
+ else
13
+ @config[:site_url] ||= "https://gitcafe.com"
14
+ @config[:api_url] ||= "https://api.gitcafe.com"
15
+ @config
16
+ end
17
+ end
18
+
6
19
  option :client_options, {
7
- :site => "https://gitcafe.com",
20
+ :site => config[:site_url],
8
21
  :authorize_url => "/oauth/authorize",
9
22
  }
10
23
 
@@ -39,7 +52,7 @@ module OmniAuth
39
52
  end
40
53
 
41
54
  def raw_info
42
- access_token.client.site = 'https://api.gitcafe.com'
55
+ access_token.client.site = self.class.config[:api_url]
43
56
  @raw_info ||= access_token.get("/api/v1/user.json").parsed
44
57
  end
45
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-gitcafe-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xyu Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-11 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth