baidu 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/baidu/response.rb +15 -0
- data/lib/baidu/version.rb +1 -1
- data/spec/sem_account_spec.rb +19 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8cf13976ee932f067da1a85dd0c307f22688113
|
4
|
+
data.tar.gz: 49ce29b70af6c244cc3fdf535e4696ffd6e3278f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c719746a1f33233383dc775fd5a184ce28750e63860d0ab4ffe0333baafc7f7aee7dc69e5101abda24b3ee6f39deb47a7dbe1ebbc223ca7a740179a3d70185a6
|
7
|
+
data.tar.gz: 0a0bf51820b48b9cf890cb0ced4470f4f2caf464a983fb8cd068c0cc024bb575a6f698b40b4a3f366f76ff27ed2c077dea071c75e53ec0797c84757df03b4f1c
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Baidu
|
2
|
+
class Response
|
3
|
+
attr_accessor :header,:body,:rquota,:quota,:status,:desc,:oprs,:oprtime
|
4
|
+
def initialize(response,name_response_sym)
|
5
|
+
@header = response.header[:res_header]
|
6
|
+
@body = response.body[name_response_sym]
|
7
|
+
@rquota = @header[:rquota].to_i
|
8
|
+
@quota = @header[:quota].to_i
|
9
|
+
@status = @header[:status].to_i
|
10
|
+
@desc = @header[:desc]
|
11
|
+
@oprs = @header[:oprs]
|
12
|
+
@oprtime = @header[:oprtime]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/baidu/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe Baidu::SEM::AccountService do
|
3
|
+
subject{Baidu::SEM::AccountService.new($auth)}
|
4
|
+
let(:options){options = {}}
|
5
|
+
describe "#getAccountInfo" do
|
6
|
+
it "getAccountInfo" do
|
7
|
+
response = subject.getAccountInfo(options)
|
8
|
+
response.status.should == 0
|
9
|
+
response.desc.should == 'success'
|
10
|
+
expect{ApiResponse.verify(response.body)}.not_to raise_error
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#updateAccountInfo' do
|
15
|
+
it "is not implemented yet" do
|
16
|
+
pending
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baidu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- seoaqua
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- lib/baidu/auth.rb
|
98
98
|
- lib/baidu/map.rb
|
99
99
|
- lib/baidu/rank.rb
|
100
|
+
- lib/baidu/response.rb
|
100
101
|
- lib/baidu/sem.rb
|
101
102
|
- lib/baidu/sem/account.rb
|
102
103
|
- lib/baidu/sem/adgroup.rb
|
@@ -113,6 +114,7 @@ files:
|
|
113
114
|
- lib/baidu/version.rb
|
114
115
|
- lib/ext.rb
|
115
116
|
- spec/map_spec.rb
|
117
|
+
- spec/sem_account_spec.rb
|
116
118
|
- spec/sem_adgroup_spec.rb
|
117
119
|
- spec/sem_api_response_spec.rb
|
118
120
|
- spec/sem_bulk_spec.rb
|
@@ -148,6 +150,7 @@ specification_version: 4
|
|
148
150
|
summary: a gem summary
|
149
151
|
test_files:
|
150
152
|
- spec/map_spec.rb
|
153
|
+
- spec/sem_account_spec.rb
|
151
154
|
- spec/sem_adgroup_spec.rb
|
152
155
|
- spec/sem_api_response_spec.rb
|
153
156
|
- spec/sem_bulk_spec.rb
|