azimuth 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +4 -0
- data/CONTRIBUTING.md +34 -0
- data/LICENSE +20 -0
- data/README.md +98 -0
- data/Rakefile +42 -0
- data/azimuth.gemspec +31 -0
- data/lib/azimuth.rb +25 -0
- data/lib/azimuth/client.rb +26 -0
- data/lib/azimuth/client/route_matrix.rb +38 -0
- data/lib/azimuth/configuration.rb +43 -0
- data/lib/azimuth/connection.rb +28 -0
- data/lib/azimuth/error.rb +45 -0
- data/lib/azimuth/request.rb +30 -0
- data/lib/azimuth/response/raise_error.rb +18 -0
- data/lib/azimuth/version.rb +5 -0
- data/spec/cassettes/Azimuth_Client_RouteMatrix/_route_matrix/behaves_like_a_route_matrix_request/returns_locations_coordinates.yml +87 -0
- data/spec/cassettes/Azimuth_Client_RouteMatrix/_route_matrix/behaves_like_a_route_matrix_request/returns_locations_distances_to_destination.yml +87 -0
- data/spec/cassettes/Azimuth_Client_RouteMatrix/_route_matrix/behaves_like_a_route_matrix_request/returns_locations_driving_times_to_destination.yml +87 -0
- data/spec/cassettes/Azimuth_Client_RouteMatrix/_route_matrix/with_all_to_all_options/it_returns_destination_informations.yml +88 -0
- data/spec/cassettes/Azimuth_Client_RouteMatrix/_route_matrix/with_many_to_one_options/does_not_return_destination_informations.yml +87 -0
- data/spec/cassettes/Azimuth_Client_RouteMatrix/_route_matrix/with_no_optionnal_options/does_not_return_destination_informations.yml +87 -0
- data/spec/lib/azimuth/client/route_matrix_spec.rb +39 -0
- data/spec/lib/azimuth/client_spec.rb +56 -0
- data/spec/lib/azimuth/request_spec.rb +11 -0
- data/spec/lib/azimuth_spec.rb +32 -0
- data/spec/spec_helper.rb +52 -0
- data/spec/support/shared_examples/error.rb +15 -0
- data/spec/support/shared_examples/route_matrix_request.rb +26 -0
- metadata +170 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
module Azimuth
|
2
|
+
# Methods for HTTP requests
|
3
|
+
module Request
|
4
|
+
# Make a HTTP POST request.
|
5
|
+
#
|
6
|
+
# @param path [String] The path, relative to api_endpoint
|
7
|
+
# @param options [Hash] body params for request
|
8
|
+
# @return [Hashie::Mash]
|
9
|
+
def post(path, options={})
|
10
|
+
request(:post, path, options)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def request(method, path, options)
|
16
|
+
response = connection.send(method) do |request|
|
17
|
+
request.params['key'] = self.api_key
|
18
|
+
|
19
|
+
case method
|
20
|
+
when :post
|
21
|
+
request.headers['Content-Type'] = 'application/json'
|
22
|
+
request.path = path
|
23
|
+
request.body = MultiJson.dump(options) unless options.empty?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
response.body
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'azimuth/error'
|
3
|
+
|
4
|
+
module Azimuth
|
5
|
+
# Faraday response middleware
|
6
|
+
module Response
|
7
|
+
# Raises a Azimuth exception based on status code returned by the API
|
8
|
+
class RaiseError < Faraday::Response::Middleware
|
9
|
+
private
|
10
|
+
|
11
|
+
def on_complete(response)
|
12
|
+
if error = Azimuth::Error.from_response(response)
|
13
|
+
raise error
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://www.mapquestapi.com/directions/v2/routematrix?key=<API_KEY>
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "{\"locations\":[\"48.843079, 2.314442\",\"48.869061, 2.383329\",\"49.000000,
|
9
|
+
2.300000\"],\"options\":{}}"
|
10
|
+
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Faraday v0.8.9
|
13
|
+
Content-Type:
|
14
|
+
- application/json
|
15
|
+
Accept-Encoding:
|
16
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
17
|
+
Accept:
|
18
|
+
- "*/*"
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Server:
|
25
|
+
- Apache-Coyote/1.1
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- OPTIONS,GET,POST
|
30
|
+
Set-Cookie:
|
31
|
+
- JSESSIONID=AB87A6D80574254DBE17257CE1F87D11; Path=/directions/; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 20 Dec 1998 01:00:00 GMT
|
34
|
+
Last-Modified:
|
35
|
+
- Mon, 13 Jan 2014 18:41:01 GMT
|
36
|
+
Cache-Control:
|
37
|
+
- no-cache, must-revalidate
|
38
|
+
Pragma:
|
39
|
+
- no-cache
|
40
|
+
Content-Type:
|
41
|
+
- application/json;charset=UTF-8
|
42
|
+
Content-Length:
|
43
|
+
- '1592'
|
44
|
+
Date:
|
45
|
+
- Mon, 13 Jan 2014 18:41:01 GMT
|
46
|
+
body:
|
47
|
+
encoding: ASCII-8BIT
|
48
|
+
string: !binary |-
|
49
|
+
eyJhbGxUb0FsbCI6ZmFsc2UsImRpc3RhbmNlIjpbMCw0LjkwOSwxNy45Njhd
|
50
|
+
LCJ0aW1lIjpbMCwxMDE5LDIxMjldLCJsb2NhdGlvbnMiOlt7ImxhdExuZyI6
|
51
|
+
eyJsbmciOjIuMzE0NDQyLCJsYXQiOjQ4Ljg0MzA3OX0sImFkbWluQXJlYTQi
|
52
|
+
OiJQYXJpcyIsImFkbWluQXJlYTVUeXBlIjoiQ2l0eSIsImFkbWluQXJlYTRU
|
53
|
+
eXBlIjoiQ291bnR5IiwiYWRtaW5BcmVhNSI6IlBhcmlzIiwic3RyZWV0Ijoi
|
54
|
+
NSBSdWUgRGFsb3UiLCJhZG1pbkFyZWExIjoiRlIiLCJhZG1pbkFyZWEzIjoi
|
55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orded_with: VCR 2.8.0
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://www.mapquestapi.com/directions/v2/routematrix?key=<API_KEY>
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "{\"locations\":[\"48.843079, 2.314442\",\"48.869061, 2.383329\",\"49.000000,
|
9
|
+
2.300000\"],\"options\":{}}"
|
10
|
+
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Faraday v0.8.9
|
13
|
+
Content-Type:
|
14
|
+
- application/json
|
15
|
+
Accept-Encoding:
|
16
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
17
|
+
Accept:
|
18
|
+
- "*/*"
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Server:
|
25
|
+
- Apache-Coyote/1.1
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- OPTIONS,GET,POST
|
30
|
+
Set-Cookie:
|
31
|
+
- JSESSIONID=53091AE2E368F0EFDFF49EB62CDEB6A1; Path=/directions/; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 20 Dec 1998 01:00:00 GMT
|
34
|
+
Last-Modified:
|
35
|
+
- Mon, 13 Jan 2014 18:40:59 GMT
|
36
|
+
Cache-Control:
|
37
|
+
- no-cache, must-revalidate
|
38
|
+
Pragma:
|
39
|
+
- no-cache
|
40
|
+
Content-Type:
|
41
|
+
- application/json;charset=UTF-8
|
42
|
+
Content-Length:
|
43
|
+
- '1592'
|
44
|
+
Date:
|
45
|
+
- Mon, 13 Jan 2014 18:40:59 GMT
|
46
|
+
body:
|
47
|
+
encoding: ASCII-8BIT
|
48
|
+
string: !binary |-
|
49
|
+
eyJhbGxUb0FsbCI6ZmFsc2UsImRpc3RhbmNlIjpbMCw0LjkwO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
dGUifV0sIm1hbnlUb09uZSI6ZmFsc2UsImluZm8iOnsiY29weXJpZ2h0Ijp7
|
81
|
+
InRleHQiOiLCqSAyMDEzIE1hcFF1ZXN0LCBJbmMuIiwiaW1hZ2VVcmwiOiJo
|
82
|
+
dHRwOi8vYXBpLm1xY2RuLmNvbS9yZXMvbXFsb2dvLmdpZiIsImltYWdlQWx0
|
83
|
+
VGV4dCI6IsKpIDIwMTMgTWFwUXVlc3QsIEluYy4ifSwic3RhdHVzY29kZSI6
|
84
|
+
MCwibWVzc2FnZXMiOltdfX0=
|
85
|
+
http_version:
|
86
|
+
recorded_at: Mon, 13 Jan 2014 18:41:00 GMT
|
87
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://www.mapquestapi.com/directions/v2/routematrix?key=<API_KEY>
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "{\"locations\":[\"48.843079, 2.314442\",\"48.869061, 2.383329\",\"49.000000,
|
9
|
+
2.300000\"],\"options\":{}}"
|
10
|
+
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Faraday v0.8.9
|
13
|
+
Content-Type:
|
14
|
+
- application/json
|
15
|
+
Accept-Encoding:
|
16
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
17
|
+
Accept:
|
18
|
+
- "*/*"
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Server:
|
25
|
+
- Apache-Coyote/1.1
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- OPTIONS,GET,POST
|
30
|
+
Set-Cookie:
|
31
|
+
- JSESSIONID=550DC7433DA92A8AEC3CC5D8D49BA7B4; Path=/directions/; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 20 Dec 1998 01:00:00 GMT
|
34
|
+
Last-Modified:
|
35
|
+
- Mon, 13 Jan 2014 18:40:57 GMT
|
36
|
+
Cache-Control:
|
37
|
+
- no-cache, must-revalidate
|
38
|
+
Pragma:
|
39
|
+
- no-cache
|
40
|
+
Content-Type:
|
41
|
+
- application/json;charset=UTF-8
|
42
|
+
Content-Length:
|
43
|
+
- '1592'
|
44
|
+
Date:
|
45
|
+
- Mon, 13 Jan 2014 18:40:57 GMT
|
46
|
+
body:
|
47
|
+
encoding: ASCII-8BIT
|
48
|
+
string: !binary |-
|
49
|
+
eyJhbGxUb0FsbCI6ZmFsc2UsImRpc3RhbmNlIjpbMCw0LjkwOSwxNy45Njhd
|
50
|
+
LCJ0aW1lIjpbMCwxMDE5LDIxMjldLCJsb2NhdGlvbnMiOlt7ImxhdExuZyI6
|
51
|
+
eyJsbmciOjIuMzE0NDQyLCJsYXQiOjQ4Ljg0MzA3OX0sImFkbWluQXJlYTQi
|
52
|
+
OiJQYXJpcyIsImFkbWluQXJlYTVUeXBlIjoiQ2l0eSIsImFkbWluQXJlYTRU
|
53
|
+
eXBlIjoiQ291bnR5IiwiYWRtaW5BcmVhNSI6IlBhcmlzIiwic3RyZWV0Ijoi
|
54
|
+
NSBSdWUgRGFsb3UiLCJhZG1pbkFyZWExIjoiRlIiLCJhZG1pbkFyZWEzIjoi
|
55
|
+
SWxlLWRlLUZyYW5jZSIsInR5cGUiOiJzIiwiZGlzcGxheUxhdExuZyI6eyJs
|
56
|
+
bmciOjIuMzE0NDQyLCJsYXQiOjQ4Ljg0MzA3OX0sImxpbmtJZCI6MCwicG9z
|
57
|
+
dGFsQ29kZSI6Ijc1MDA3Iiwic2lkZU9mU3RyZWV0IjoiTiIsImRyYWdQb2lu
|
58
|
+
dCI6ZmFsc2UsImFkbWluQXJlYTFUeXBlIjoiQ291bnRyeSIsImdlb2NvZGVR
|
59
|
+
dWFsaXR5IjoiQUREUkVTUyIsImdlb2NvZGVRdWFsaXR5Q29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ZS1GcmFu
|
75
|
+
Y2UiLCJ0eXBlIjoicyIsImRpc3BsYXlMYXRMbmciOnsibG5nIjoyLjMsImxh
|
76
|
+
dCI6NDl9LCJsaW5rSWQiOjAsInBvc3RhbENvZGUiOiI5NTU4MCIsInNpZGVP
|
77
|
+
ZlN0cmVldCI6Ik4iLCJkcmFnUG9pbnQiOmZhbHNlLCJhZG1pbkFyZWExVHlw
|
78
|
+
ZSI6IkNvdW50cnkiLCJnZW9jb2RlUXVhbGl0eSI6IkFERFJFU1MiLCJnZW9j
|
79
|
+
b2RlUXVhbGl0eUNvZGUiOiJMMUFBQSIsImFkbWluQXJlYTNUeXBlIjoiU3Rh
|
80
|
+
dGUifV0sIm1hbnlUb09uZSI6ZmFsc2UsImluZm8iOnsiY29weXJpZ2h0Ijp7
|
81
|
+
InRleHQiOiLCqSAyMDEzIE1hcFF1ZXN0LCBJbmMuIiwiaW1hZ2VVcmwiOiJo
|
82
|
+
dHRwOi8vYXBpLm1xY2RuLmNvbS9yZXMvbXFsb2dvLmdpZiIsImltYWdlQWx0
|
83
|
+
VGV4dCI6IsKpIDIwMTMgTWFwUXVlc3QsIEluYy4ifSwic3RhdHVzY29kZSI6
|
84
|
+
MCwibWVzc2FnZXMiOltdfX0=
|
85
|
+
http_version:
|
86
|
+
recorded_at: Mon, 13 Jan 2014 18:40:58 GMT
|
87
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,88 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://www.mapquestapi.com/directions/v2/routematrix?key=<API_KEY>
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "{\"locations\":[\"48.843079, 2.314442\",\"48.869061, 2.383329\",\"49.000000,
|
9
|
+
2.300000\"],\"options\":{\"allToAll\":true}}"
|
10
|
+
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Faraday v0.8.9
|
13
|
+
Content-Type:
|
14
|
+
- application/json
|
15
|
+
Accept-Encoding:
|
16
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
17
|
+
Accept:
|
18
|
+
- "*/*"
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Server:
|
25
|
+
- Apache-Coyote/1.1
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- OPTIONS,GET,POST
|
30
|
+
Set-Cookie:
|
31
|
+
- JSESSIONID=45696A3B211DA254A8F6D883E5E2D097; Path=/directions/; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 20 Dec 1998 01:00:00 GMT
|
34
|
+
Last-Modified:
|
35
|
+
- Mon, 13 Jan 2014 18:41:03 GMT
|
36
|
+
Cache-Control:
|
37
|
+
- no-cache, must-revalidate
|
38
|
+
Pragma:
|
39
|
+
- no-cache
|
40
|
+
Content-Type:
|
41
|
+
- application/json;charset=UTF-8
|
42
|
+
Content-Length:
|
43
|
+
- '1658'
|
44
|
+
Date:
|
45
|
+
- Mon, 13 Jan 2014 18:41:02 GMT
|
46
|
+
body:
|
47
|
+
encoding: ASCII-8BIT
|
48
|
+
string: !binary |-
|
49
|
+
eyJhbGxUb0FsbCI6dHJ1ZSwiZGlzdGFuY2UiOltbMCw0LjkwOSwxNy45Njhd
|
50
|
+
LFs1LjEwMywwLDEzLjg0Ml0sWzE0LjQ1NCwxNC4zMjYsMF1dLCJ0aW1lIjpb
|
51
|
+
WzAsMTAxOSwyMTI5XSxbMTA0NiwwLDE5NDZdLFsyMTQ4LDE5NTAsMF1dLCJs
|
52
|
+
b2NhdGlvbnMiOlt7ImxhdExuZyI6eyJsbmciOjIuMzE0NDQyLCJsYXQiOjQ4
|
53
|
+
Ljg0MzA3OX0sImFkbWluQXJlYTQiOiJQYXJpcyIsImFkbWluQXJlYTVUeXBl
|
54
|
+
IjoiQ2l0eSIsImFkbWlu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pIDIwMTMgTWFwUXVlc3Qs
|
85
|
+
IEluYy4ifSwic3RhdHVzY29kZSI6MCwibWVzc2FnZXMiOltdfX0=
|
86
|
+
http_version:
|
87
|
+
recorded_at: Mon, 13 Jan 2014 18:41:03 GMT
|
88
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://www.mapquestapi.com/directions/v2/routematrix?key=<API_KEY>
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "{\"locations\":[\"48.843079, 2.314442\",\"48.869061, 2.383329\",\"49.000000,
|
9
|
+
2.300000\"],\"options\":{\"manyToOne\":true}}"
|
10
|
+
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Faraday v0.8.9
|
13
|
+
Content-Type:
|
14
|
+
- application/json
|
15
|
+
Accept-Encoding:
|
16
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
17
|
+
Accept:
|
18
|
+
- "*/*"
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Server:
|
25
|
+
- Apache-Coyote/1.1
|
26
|
+
Access-Control-Allow-Origin:
|
27
|
+
- "*"
|
28
|
+
Access-Control-Allow-Methods:
|
29
|
+
- OPTIONS,GET,POST
|
30
|
+
Set-Cookie:
|
31
|
+
- JSESSIONID=C8C4C83AA88D4B04E1D134405331AB9D; Path=/directions/; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 20 Dec 1998 01:00:00 GMT
|
34
|
+
Last-Modified:
|
35
|
+
- Mon, 13 Jan 2014 18:40:53 GMT
|
36
|
+
Cache-Control:
|
37
|
+
- no-cache, must-revalidate
|
38
|
+
Pragma:
|
39
|
+
- no-cache
|
40
|
+
Content-Type:
|
41
|
+
- application/json;charset=UTF-8
|
42
|
+
Content-Length:
|
43
|
+
- '1591'
|
44
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