baidu_api-geocoding 1.0.0 → 1.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08ae480fdaec595e85d8b3b537f648d84266b754
|
4
|
+
data.tar.gz: 791ad1f0ded3d8bb64bcd6417baeb582d6333a3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 919e3beaa89cca51685333699a8da3f2837b83cba53f5797087bca20491c671c944bc8970a0653e82b750b8e532b347e4a24f9aef67c831152d96fcf53da5066
|
7
|
+
data.tar.gz: 964d438cf85000bc187b82d2422a69a395e41cdf46970ca07e0148bd180d33dc25bb1f0c69ed632ce3d1d1b8aedf28aa0bbeffbbbbfdbb56f830507167b5987f
|
data/lib/baidu_api/geocoding.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'baidu_api/geocoding/version'
|
3
3
|
require 'baidu_api/geocoding/configuration'
|
4
|
+
require 'baidu_api/geocoding/exceptions/failed'
|
4
5
|
require 'baidu_api/geocoding/v2/geocoder'
|
5
6
|
|
6
7
|
module BaiduApi
|
@@ -27,6 +28,12 @@ module BaiduApi
|
|
27
28
|
geocoder.geocode(data)
|
28
29
|
end
|
29
30
|
|
31
|
+
def geocode!(data = {})
|
32
|
+
ret = geocode(data)
|
33
|
+
raise BaiduApi::Geocoding::Exceptions::Failed, ret if ret['status'] != 0
|
34
|
+
ret
|
35
|
+
end
|
36
|
+
|
30
37
|
def fetch_accepted_data(data)
|
31
38
|
%w(ak sk version address city coordtype location pois).inject({}) do |ret, item|
|
32
39
|
ret[item.intern] = fetch_data(data, item)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baidu_api-geocoding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xiaohui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- baidu_api-geocoding.gemspec
|
54
54
|
- lib/baidu_api/geocoding.rb
|
55
55
|
- lib/baidu_api/geocoding/configuration.rb
|
56
|
+
- lib/baidu_api/geocoding/exceptions/failed.rb
|
56
57
|
- lib/baidu_api/geocoding/v2/geocoder.rb
|
57
58
|
- lib/baidu_api/geocoding/version.rb
|
58
59
|
homepage: http://github.com/xiaohui-zhangxh/baidu_api-geocoding
|