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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3ab3b16d4f810561f78ee164b2882eaf8f2bae8
4
- data.tar.gz: 706fc2deeb2af8c5606eb685f1c85aef45f85127
3
+ metadata.gz: a8cf13976ee932f067da1a85dd0c307f22688113
4
+ data.tar.gz: 49ce29b70af6c244cc3fdf535e4696ffd6e3278f
5
5
  SHA512:
6
- metadata.gz: be21dae1919c0f313870b2b0a508304becc13117072bc0c93d7992f9cb992aaba344b30c9af36eee6fea2ec75d96c79a8a94af72430c36468998363987408811
7
- data.tar.gz: a3f515b1a9ed7be68eb66437c1038e78ee068304fe1c13f0492c66f23a5bd3bef159f10eb1d2e3c867d946fe921e59375cd4589b6d56ce38d29cf3757e0635c7
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
@@ -1,3 +1,3 @@
1
1
  module Baidu
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -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.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