qihu360 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 243732175d9fe1d94ad688e68f6a7f3aa3dce2a7
4
- data.tar.gz: 70378a3818685183d66012403677b5eb9c6ebeb7
3
+ metadata.gz: 0bad2c629ac3dfc34186ce48b0df371db3316eea
4
+ data.tar.gz: b038c401fcf5caf2bf190c17ffdd85e2f4874b82
5
5
  SHA512:
6
- metadata.gz: b8a7121f6da926a1e75a50ba50190a374e79b13ba88ac19915bef748dc1c822cabbae995899e45065f1d172f35761750f7a17c2b5181188cea12816994e06773
7
- data.tar.gz: 9bf63cfc46700ee442b0ea0bacbf65557d169e342360d151598f7b6a310bf9cdff8661876ddedf747f1384d9389c024e425b94b37833d384f1a4ede6fa730a0d
6
+ metadata.gz: 8ac100ff02a864f36cbff21e0fe504aece47d0b1d2d108c71922c4fe32f90d58c3c355eff5d44849f0e0c74e2d6fc2388ce91634fddeda3e5d8f9c07ad845cb6
7
+ data.tar.gz: 415e8f083074eb16fd3e0bd0add4fe46e2e5a39cd4ecc52a588f98585a3393c411916ab273b66919b578be5ae1eb830ef871ac7e93ef067c58d2367cf004e8b5
data/README.md CHANGED
@@ -41,7 +41,16 @@
41
41
  # 获取的 access token
42
42
  token = auth.get_token('code')
43
43
 
44
- ### 使用用户名和密码获得 access token
44
+ #### 使用 access token 初始化
45
+
46
+ auth = Qihu::Auth.new(id:'xxx', secret:'yyy', token:{
47
+ :access_token => 'zzz', :refresh_token => 'qqq', :expires_at => 36000
48
+ })
49
+
50
+ // 或者这样传递 access token
51
+ auth.get_token_from_hash(:access_token => 'zzz', :refresh_token => 'qqq', :expires_at => 36000)
52
+
53
+ #### 使用用户名和密码获得 access token
45
54
 
46
55
  # 处理 oauth2
47
56
  auth = Qihu::Auth.new(id:'xxx', secret:'yyy')
@@ -55,16 +64,6 @@
55
64
  # 或者直接一步到位
56
65
  token = auth.get_token_from_account('username', 'password')
57
66
 
58
-
59
- #### 使用 access token 初始化
60
-
61
- auth = Qihu::Auth.new(id:'xxx', secret:'yyy', token:{
62
- :access_token => 'zzz', :refresh_token => 'qqq', :expires_at => 36000
63
- })
64
-
65
- // 或者这样传递 access token
66
- auth.get_token_from_hash(:access_token => 'zzz', :refresh_token => 'qqq', :expires_at => 36000)
67
-
68
67
  #### 如何刷新 access token
69
68
 
70
69
  auth = Qihu::Auth.new('xxx', 'yyy', token:{
@@ -26,8 +26,11 @@ module Qihu
26
26
  end
27
27
 
28
28
  uri_path = uri_path(name)
29
- r = @client.auth.token.request(method, uri_path, :headers => client_headers, :params => params)
30
-
29
+ if method == :get
30
+ r = @client.auth.token.request(method, uri_path, :headers => client_headers, :params => params)
31
+ else
32
+ r = @client.auth.token.request(method, uri_path, :headers => client_headers, :body => params)
33
+ end
31
34
  if self.json?(r.headers)
32
35
  data = self.to_json(r.body)
33
36
  elsif self.xml?(r.headers)
@@ -1,3 +1,3 @@
1
1
  module Qihu
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qihu360
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: oauth2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.9.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: multi_json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: multi_xml
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.5'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.5'
83
83
  description: Qihu 360.cn OAuth2 & Dianjing(Advertising system) API wrapper
@@ -87,8 +87,8 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rspec
90
+ - ".gitignore"
91
+ - ".rspec"
92
92
  - Gemfile
93
93
  - LICENSE.txt
94
94
  - README.md
@@ -121,17 +121,17 @@ require_paths:
121
121
  - lib
122
122
  required_ruby_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.0.14
134
+ rubygems_version: 2.2.2
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Qihu 360.cn OAuth2 & Dianjing API wrapper