osrm 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/README.md +4 -3
- data/lib/osrm/configuration.rb +9 -0
- data/lib/osrm/query.rb +1 -1
- data/lib/osrm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2b0e1a19f60acce52fa8804cef3f4ee2abe5f9f50d3b65d6f653d3ead4c6a548
|
|
4
|
+
data.tar.gz: 9500982f84cb033d751afc9735dabf9a639d1535ad8a804c6e04e80581fb63e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5bb8efacccb5568c62b511d9293e956832941956e20b584b773e5d0ffd2da5a2e2d3ed840e5de61fb80d338f91b543844830f1e75be72fa5ec54f03f7a3e0667
|
|
7
|
+
data.tar.gz: 292eb04e7961e6c7d7a44c1c3a0faee5628a146051f302bfa545bfb11a0c20a83ebed0ccb3f9683873c941c0f508cf345e475134a9e1e38767c624fd2fbaffbe
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -15,9 +15,10 @@ You can [run your own server](https://github.com/Project-OSRM/osrm-backend/wiki)
|
|
|
15
15
|
OSRM.configure(
|
|
16
16
|
|
|
17
17
|
# Connection
|
|
18
|
-
server:
|
|
19
|
-
port:
|
|
20
|
-
use_ssl:
|
|
18
|
+
server: 'example.com', # Must be specified
|
|
19
|
+
port: 8080, # Default: 80 or 443 if SSL
|
|
20
|
+
use_ssl: true, # Default: false
|
|
21
|
+
path_prefix: '/optional/path', # Default: ''
|
|
21
22
|
## OSRM demo server connection
|
|
22
23
|
# server: :demo,
|
|
23
24
|
## Mapbox server connection
|
data/lib/osrm/configuration.rb
CHANGED
|
@@ -10,6 +10,7 @@ module OSRM
|
|
|
10
10
|
port: nil,
|
|
11
11
|
use_ssl: false,
|
|
12
12
|
api_key: nil,
|
|
13
|
+
path_prefix: '',
|
|
13
14
|
|
|
14
15
|
timeout: 3,
|
|
15
16
|
user_agent: "OSRMRubyGem/#{OSRM::VERSION}",
|
|
@@ -67,6 +68,14 @@ module OSRM
|
|
|
67
68
|
@data[:use_ssl] = use_ssl ? true : false
|
|
68
69
|
end
|
|
69
70
|
|
|
71
|
+
def path_prefix=(path_prefix)
|
|
72
|
+
unless path_prefix.empty? || path_prefix.match?(/\A\/.*[^\/]\z/)
|
|
73
|
+
raise "OSRM API error: Invalid path prefix #{path_prefix.inspect}"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
@data[:path_prefix] = path_prefix
|
|
77
|
+
end
|
|
78
|
+
|
|
70
79
|
def timeout=(timeout)
|
|
71
80
|
@data[:timeout] = timeout&.to_i
|
|
72
81
|
end
|
data/lib/osrm/query.rb
CHANGED
|
@@ -126,7 +126,7 @@ module OSRM
|
|
|
126
126
|
@uri = uri_class.build(
|
|
127
127
|
host: configuration.server,
|
|
128
128
|
port: configuration.port,
|
|
129
|
-
path: "/#{service}/#{version}/#{profile}/#{lonlat_locations.join(';')}.#{format}",
|
|
129
|
+
path: "#{configuration.path_prefix}/#{service}/#{version}/#{profile}/#{lonlat_locations.join(';')}.#{format}",
|
|
130
130
|
query: URI.encode_www_form(params)
|
|
131
131
|
)
|
|
132
132
|
end
|
data/lib/osrm/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: osrm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Freayd
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
118
|
version: '0'
|
|
119
119
|
requirements: []
|
|
120
120
|
rubyforge_project:
|
|
121
|
-
rubygems_version: 2.
|
|
121
|
+
rubygems_version: 2.7.7
|
|
122
122
|
signing_key:
|
|
123
123
|
specification_version: 4
|
|
124
124
|
summary: OSRM API for Ruby
|