baidu_api-lbs_cloud 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 +4 -4
- data/README.md +4 -0
- data/lib/baidu_api/lbs_cloud/exceptions/failed.rb +9 -0
- data/lib/baidu_api/lbs_cloud/v3/geodata/column.rb +2 -0
- data/lib/baidu_api/lbs_cloud/v3/geodata/geotable.rb +2 -0
- data/lib/baidu_api/lbs_cloud/v3/geodata/job.rb +2 -0
- data/lib/baidu_api/lbs_cloud/v3/geodata/poi.rb +2 -0
- data/lib/baidu_api/lbs_cloud/v3/request_base.rb +12 -0
- data/lib/baidu_api/lbs_cloud/version.rb +1 -1
- data/lib/baidu_api/lbs_cloud.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edec3c2e38a4c941c7d6574ede3bbb68ad33020a
|
4
|
+
data.tar.gz: a86eae6df13051b957171a72120adf67b93c070d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21589efba8f43762bb4152180af469dcaa81babe186f48887277f0ed94b698eaa72278513e1a0e3d11630016304e5cc1b617eea268e004d636ba456177af48c0
|
7
|
+
data.tar.gz: e6bfcfb376587627aff5f8927c511522e5bcc1dc9ced5327eaf7db4ac52b7a5e2034636251aeb9e9c712ab0f38ee0900d975a3ca64396a611ef5ee00dd0bf785
|
data/README.md
CHANGED
@@ -44,6 +44,10 @@ geodata.geotable.list()
|
|
44
44
|
geodata.geotable.create(name: 'mytest', geotype: 3, is_published: 0)
|
45
45
|
=> {"status"=>0, "id"=>90288, "message"=>"成功"}
|
46
46
|
|
47
|
+
# rails error if status is non-zero
|
48
|
+
geodata.geotable.create!(name: 'mytest')
|
49
|
+
BaiduApi::LbsCloud::Exceptions::Failed: geotype:参数必需
|
50
|
+
|
47
51
|
# Call Geosearch APIs
|
48
52
|
|
49
53
|
BaiduApi::LbsCloud::V3::Geosearch.setup ak: 'xxx', sk: 'xxx'
|
@@ -28,6 +28,18 @@ module BaiduApi::LbsCloud::V3::RequestBase
|
|
28
28
|
@controller
|
29
29
|
end
|
30
30
|
|
31
|
+
def add_raise_methods(*methods)
|
32
|
+
methods.flatten.each do |m|
|
33
|
+
class_eval <<-CODE
|
34
|
+
def #{m}!(*args)
|
35
|
+
ret = #{m}(*args)
|
36
|
+
raise BaiduApi::LbsCloud::Exceptions::Failed.new(ret) if ret['status'] != 0
|
37
|
+
ret
|
38
|
+
end
|
39
|
+
CODE
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
31
43
|
end
|
32
44
|
|
33
45
|
attr_accessor :ak, :sk
|
data/lib/baidu_api/lbs_cloud.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baidu_api-lbs_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xiaohui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- Rakefile
|
67
67
|
- baidu_api-lbs_cloud.gemspec
|
68
68
|
- lib/baidu_api/lbs_cloud.rb
|
69
|
+
- lib/baidu_api/lbs_cloud/exceptions/failed.rb
|
69
70
|
- lib/baidu_api/lbs_cloud/v3.rb
|
70
71
|
- lib/baidu_api/lbs_cloud/v3/geodata.rb
|
71
72
|
- lib/baidu_api/lbs_cloud/v3/geodata/column.rb
|