google-maps 3.0.6 → 3.0.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 413ed7b9a370d5b4ccf30a72d670406c8c286825e65d3e537856f5efe6f5e8d0
|
4
|
+
data.tar.gz: 2d6ae4b61bd9d65c6e8a785f2fb7c0a3d410f997d819a74dfeb31067f04606c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79e462c797191eb7c8824573acb26cb19f106cc15880f1ae0585526f0ef99bb7a0901c42f0e5ee6b2f71ee9eade1eaa20fdf95808f6e9e02930b181475629cf9
|
7
|
+
data.tar.gz: bd1c83ee4c7dc6ad2d73fd22871151fe473743744c60ca6883290d661edf8f3071c4835d1e3e53f9acd4d55560622f35dd16b490c323e45e31fefd79dc1b9d20
|
data/google-maps.gemspec
CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency('rubocop', '~> 0.79.0')
|
29
29
|
s.add_development_dependency('simplecov', '~> 0.5')
|
30
30
|
s.add_development_dependency('yard', '~> 0.9', '>= 0.9.11')
|
31
|
-
s.add_dependency('hashie', '~>
|
31
|
+
s.add_dependency('hashie', '~> 4.1', '>= 4.1.0')
|
32
32
|
s.add_dependency('httpclient', '~> 2.7', '>= 2.7.1')
|
33
|
-
s.add_dependency('
|
33
|
+
s.add_dependency('multi_json', '>= 1.15')
|
34
34
|
s.add_dependency('ruby-hmac', '~> 0.4.0')
|
35
35
|
end
|
data/lib/google_maps/api.rb
CHANGED
@@ -63,13 +63,13 @@ module Google
|
|
63
63
|
Google::Maps.logger.error e.message.to_s
|
64
64
|
raise InvalidResponseException, "unknown error: #{e.message}"
|
65
65
|
end
|
66
|
-
handle_result_status(result.status)
|
66
|
+
handle_result_status(result.status, result.error_message)
|
67
67
|
result
|
68
68
|
end
|
69
69
|
|
70
|
-
def handle_result_status(status)
|
71
|
-
raise ZeroResultsException, "
|
72
|
-
raise InvalidResponseException, "
|
70
|
+
def handle_result_status(status, error_message)
|
71
|
+
raise ZeroResultsException, "#{status}: #{error_message}" if status == STATUS_ZERO_RESULTS
|
72
|
+
raise InvalidResponseException, "#{status}: #{error_message}" if status != STATUS_OK
|
73
73
|
end
|
74
74
|
|
75
75
|
def url_with_api_key(service, args = {})
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
def element
|
28
28
|
element = distance_matrix.rows.first.elements.first
|
29
29
|
|
30
|
-
raise Google::Maps::ZeroResultsException if element.status == 'NOT_FOUND'
|
30
|
+
raise Google::Maps::ZeroResultsException if (element.status == 'NOT_FOUND' || element.status == 'ZERO_RESULTS')
|
31
31
|
|
32
32
|
element
|
33
33
|
end
|
data/lib/google_maps/version.rb
CHANGED
@@ -12,5 +12,16 @@ describe Google::Maps::DistanceMatrix do
|
|
12
12
|
its(:distance) { should eq 53_744 }
|
13
13
|
its(:duration) { should eq 3237 }
|
14
14
|
end
|
15
|
+
|
16
|
+
context ':nl and zero results' do
|
17
|
+
before { stub_response('distance-matrix-zero-results.json') }
|
18
|
+
|
19
|
+
it 'raises Google::Maps::ZeroResultsException' do
|
20
|
+
|
21
|
+
expect { subject.distance }.to raise_error(Google::Maps::ZeroResultsException)
|
22
|
+
expect { subject.duration }.to raise_error(Google::Maps::ZeroResultsException)
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
15
26
|
end
|
16
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel van Hoesel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -162,20 +162,20 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
165
|
+
version: '4.1'
|
166
166
|
- - ">="
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version:
|
168
|
+
version: 4.1.0
|
169
169
|
type: :runtime
|
170
170
|
prerelease: false
|
171
171
|
version_requirements: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
173
|
- - "~>"
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: '
|
175
|
+
version: '4.1'
|
176
176
|
- - ">="
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
178
|
+
version: 4.1.0
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: httpclient
|
181
181
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,19 +197,19 @@ dependencies:
|
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: 2.7.1
|
199
199
|
- !ruby/object:Gem::Dependency
|
200
|
-
name:
|
200
|
+
name: multi_json
|
201
201
|
requirement: !ruby/object:Gem::Requirement
|
202
202
|
requirements:
|
203
203
|
- - ">="
|
204
204
|
- !ruby/object:Gem::Version
|
205
|
-
version: 1.
|
205
|
+
version: '1.15'
|
206
206
|
type: :runtime
|
207
207
|
prerelease: false
|
208
208
|
version_requirements: !ruby/object:Gem::Requirement
|
209
209
|
requirements:
|
210
210
|
- - ">="
|
211
211
|
- !ruby/object:Gem::Version
|
212
|
-
version: 1.
|
212
|
+
version: '1.15'
|
213
213
|
- !ruby/object:Gem::Dependency
|
214
214
|
name: ruby-hmac
|
215
215
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,6 +254,7 @@ files:
|
|
254
254
|
- spec/fixtures/den-haag-nl.json
|
255
255
|
- spec/fixtures/deventer-en.json
|
256
256
|
- spec/fixtures/deventer-nl.json
|
257
|
+
- spec/fixtures/distance-matrix-zero-results.json
|
257
258
|
- spec/fixtures/distance-matrix.json
|
258
259
|
- spec/fixtures/geocoder/amsterdam-en.json
|
259
260
|
- spec/fixtures/geocoder/science-park-400-amsterdam-en.json
|
@@ -273,7 +274,7 @@ homepage: http://zilverline.com/
|
|
273
274
|
licenses:
|
274
275
|
- MIT
|
275
276
|
metadata: {}
|
276
|
-
post_install_message:
|
277
|
+
post_install_message:
|
277
278
|
rdoc_options: []
|
278
279
|
require_paths:
|
279
280
|
- lib
|
@@ -288,8 +289,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
289
|
- !ruby/object:Gem::Version
|
289
290
|
version: '0'
|
290
291
|
requirements: []
|
291
|
-
rubygems_version: 3.
|
292
|
-
signing_key:
|
292
|
+
rubygems_version: 3.2.15
|
293
|
+
signing_key:
|
293
294
|
specification_version: 4
|
294
295
|
summary: Ruby wrapper for the Google Maps API
|
295
296
|
test_files:
|
@@ -298,6 +299,7 @@ test_files:
|
|
298
299
|
- spec/fixtures/den-haag-nl.json
|
299
300
|
- spec/fixtures/deventer-en.json
|
300
301
|
- spec/fixtures/deventer-nl.json
|
302
|
+
- spec/fixtures/distance-matrix-zero-results.json
|
301
303
|
- spec/fixtures/distance-matrix.json
|
302
304
|
- spec/fixtures/geocoder/amsterdam-en.json
|
303
305
|
- spec/fixtures/geocoder/science-park-400-amsterdam-en.json
|