xoauth 0.2.6 → 0.2.7

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: a716f73ea3176bb4780244190b31e8d1df2be885
4
- data.tar.gz: 964292a77efdb330133bf38fb36ce20ec90aeba5
3
+ metadata.gz: f826eae0a3c110b25274e5d24eef9badbc743b33
4
+ data.tar.gz: 6f56a965dbf111484d56f1c052e8a2c0ae9ad2f3
5
5
  SHA512:
6
- metadata.gz: 92f7ea7e579ef9cea6bfcebfcaad37b2b63388d4a2ca56ccdf6ec05670a40327d32ab02b504da0d889d39ceb5437cd25c74c5116d7a5dc3b696ac14fc08efcf5
7
- data.tar.gz: c8e367a6ac675f5cd4e88a9163ec843f77819c449db189f90e2250388a5517bd7eb16ee87cd6b11c948872ca45be84e01cdc85f367306a48a8ac09b12a7912e6
6
+ metadata.gz: 91ba46879d068b6e713935a75d6c40615a8d055b40d9cf802347d57519a90dd527f9c02286368dca5ac921b65d8710035b0fd2e5b198b5a20e29014c8c15817f
7
+ data.tar.gz: f89fa2b17d92c8650aaf83a5214fcb17382aa43425041a92857c57e469fad173616a518f2a0c45894632f0aea533091a5b04588ae07e4dcd9d6f4e92988abc53
@@ -1,5 +1,5 @@
1
1
  module Oauth
2
- class QQ < Provider
2
+ class Qq < Provider
3
3
 
4
4
  def fetch_info
5
5
  api_access('get_user_info')
@@ -7,18 +7,18 @@ module Oauth
7
7
 
8
8
  def basic_info
9
9
  info && {
10
- "name" => info.data["name"],
11
- "avatar" => info.data["avatar_hd"] || info.data["avatar_large"],
12
- "gender" => info.data["gender"],
13
- "location" => info.data["location"],
14
- "description" => info.data["description"]
10
+ "name" => info.data["nickname"],
11
+ "avatar" => info.data["figureurl_2"],
12
+ "gender" => (info.data["gender"] == '女' ? 0 : 1),
13
+ "location" => info.data["city"],
14
+ "description" => nil
15
15
  }
16
16
  end
17
17
 
18
18
  def api_access(api, http_params = {}, http_method = 'get')
19
19
  url = 'https://graph.qq.com/user/' + api
20
20
  http_params.merge!({"access_token" => access_token, "openid"=> uid, "oauth_consumer_key" => Configure['qq']['appid']})
21
- Oauth::QQ.request(url, http_params, http_method, 'json')
21
+ Oauth::Qq.request(url, http_params, http_method, 'json')
22
22
  end
23
23
 
24
24
  class << self
@@ -53,7 +53,7 @@ module Oauth
53
53
  code: code,
54
54
  redirect_uri: Configure['qq']['callback']
55
55
  }
56
- response = getJSON('https://graph.qq.com/oauth2.0/token', get_params)
56
+ response = get('https://graph.qq.com/oauth2.0/token', get_params)
57
57
  if response # access_token=xxx&expires_in=7776000&refresh_token=xxx
58
58
  detail = Hash[response.split('&').map{|q| q.split('=')}]
59
59
  detail['uid'] = openid(detail["access_token"])
@@ -69,5 +69,5 @@ module Oauth
69
69
  end
70
70
 
71
71
  end
72
- class QQMobile < QQ; end
72
+ class QqMobile < Qq; end
73
73
  end
data/lib/oauth/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oauth
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xoauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - binz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-31 00:00:00.000000000 Z
11
+ date: 2015-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler