social_oauth_api 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDI0NTNjMjk4NjgyZWRjOWY3NmNlOWQ4Y2E0ODQ5YTk3NzYxMzA4Nw==
4
+ MmI4MGQxYzMxY2I1NWI2NDA0NjViNmE0ZDFmNWQ5OGQwNzQzOTA4OQ==
5
5
  data.tar.gz: !binary |-
6
- ZWE0YzFhYzc0YjFlOTliZWZlMWExNGY0MWM5ZTUzOTQ0YzdiMGI5Mg==
6
+ NDAyYWYyYjNmYmFlZGNkMThhYjMwYTVjZmNlNDgyMWIxMWVhOTcxYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDk4ZTE0YTNkZTVmMmUyYjk4YWY1ZDg5OTE0MTBlM2VlMzQ0NWZhYzM2YzUz
10
- YTg0ZGNkNWU5YzQ4MGEwZWIzYTRjNGZhNDQ4YjMyZTYzNzBjYmE1MzBhMDQ4
11
- YmNiOGU1OWFkYmQ2NzRlMWU3NTFjYjUxMmQwMGM4MGNmYjg3YWU=
9
+ MGZiYzUwNGQ2M2MxY2Y0OTIyN2FjZWY1NjVlNWEyNTczNDdhOTM3NGQwNmRj
10
+ YzI1NmFjMTU1OTE4YWRjZmYwODJmM2VkNzdhOGYyNDc0ZWNiZGYyNDIwNTA1
11
+ YzUyOGNmNWFjOTE3NmUyNWE5ODkzZDA4Njc0NDA2ZDllYjNiY2E=
12
12
  data.tar.gz: !binary |-
13
- MmM5ZGM1MzJmNGU1OGNiOTk3NDQ1MjM0MDk2YmE4Y2FiMDRlZjcxMDQ5OTkx
14
- NDQ2NjZjYTY2YzFkM2Q3NTY4Y2ViMWNjNmNmMjY2ZWM3OTlmN2E1ZTI2Zjg5
15
- ZmQ1MzJkZWVkNDI3YTAzZjA4ZWNiMjM2MGVkZjE0ZjdiMzYyYzQ=
13
+ MGY0OGQyNDBjOTE2OTUwYmQ5ODFkZTFjYTc4OGViYmQyOTgxYjFmYWE1NTQw
14
+ NTVjYTZmNzIzODAxYjNiM2JlNzkzMTMzODFkMTc2NjRkODYxZmFmYTkxYjQy
15
+ OGI1MWMzN2EzNTViOTcwNjhkZWUwMjc0MTM1ZWE4ODIyM2MyZDk=
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # SocialOauthApi
2
2
 
3
- TODO: Write a gem description
3
+ 用于第三方登录后获取用户信息
4
+
5
+ 提供给前后端分离的框架使用
6
+
7
+ 只接受前端sdk传回来的第三方 **access_token** 参数
8
+
9
+ 支持微博和qq登录
4
10
 
5
11
  ## Installation
6
12
 
@@ -17,8 +23,31 @@ Or install it yourself as:
17
23
  $ gem install social_oauth_api
18
24
 
19
25
  ## Usage
20
-
21
- TODO: Write usage instructions here
26
+ ```ruby
27
+ require 'social_oauth_api'
28
+
29
+ weibo_config = {
30
+ client_id: 'xxxxxx',
31
+ access_token: 'xxxxxxxxxxx',
32
+ }
33
+
34
+ qq_config = {
35
+ client_id: 'xxxxx',
36
+ access_token: 'xxxxxxxxxxx'
37
+ }
38
+
39
+ weibo = SocialOauthApi::Weibo::User.new(weibo_config)
40
+ p weibo.id # => weibo uid
41
+ p weibo.name # => weibo screen_name
42
+ p weibo.image_url # => weibo profile_image_url
43
+ p weibo.user_info
44
+
45
+ qq = SocialOauthApi::Qq::User.new(qq_config)
46
+ p qq.id # => qq open_id
47
+ p qq.name # => qq nickname
48
+ p qq.name # => qq figureurl
49
+ p qq.user_info
50
+ ```
22
51
 
23
52
  ## Contributing
24
53
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module SocialOauthApi
2
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
3
5
  end
@@ -30,6 +30,7 @@ module SocialOauthApi
30
30
  alias :id :uid
31
31
  alias :name :screen_name
32
32
  alias :image_url :profile_image_url
33
+ alias :user_info :show
33
34
  end
34
35
  end
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_oauth_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spirit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler