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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a3e00cd5a5d7bde54b3fe400a7ebcf19a8cffb21
4
- data.tar.gz: ccfa16995aee6a23d30ab2ecd17bf790a98c0a25
2
+ SHA256:
3
+ metadata.gz: 2b0e1a19f60acce52fa8804cef3f4ee2abe5f9f50d3b65d6f653d3ead4c6a548
4
+ data.tar.gz: 9500982f84cb033d751afc9735dabf9a639d1535ad8a804c6e04e80581fb63e1
5
5
  SHA512:
6
- metadata.gz: baacfa133e82d5abdbf90500976610c11ceb8f00c22424167408f6192af4269bbecb638188e4d399baf4fc3e663581a4f33cc7c63b5f5cc865fef51ac7c63810
7
- data.tar.gz: 4890da8579a01c2fc032da8112903b4a83b1848271a556b71391c8adbd81e92eda2dded59c3e0fa88136f4636c9d784e492b001fe24d1cc85e1603b036e1fa42
6
+ metadata.gz: 5bb8efacccb5568c62b511d9293e956832941956e20b584b773e5d0ffd2da5a2e2d3ed840e5de61fb80d338f91b543844830f1e75be72fa5ec54f03f7a3e0667
7
+ data.tar.gz: 292eb04e7961e6c7d7a44c1c3a0faee5628a146051f302bfa545bfb11a0c20a83ebed0ccb3f9683873c941c0f508cf345e475134a9e1e38767c624fd2fbaffbe
@@ -1,5 +1,9 @@
1
1
  ## Changelog
2
2
 
3
+ ### OSRM Gem 0.5.0 (2018 Jul 5) ###
4
+
5
+ * Add path prefix configuration option
6
+
3
7
  ### OSRM Gem 0.4.3 (2017 Aug 5) ###
4
8
 
5
9
  * Fix bug in URI construction
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2017 Freayd
1
+ Copyright (c) 2014-2018 Freayd
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
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: 'example.com', # Must be specified
19
- port: 8080, # Default: 80 or 443 if SSL
20
- use_ssl: true, # Default: false
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
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OSRM
2
- VERSION = '0.4.3'
2
+ VERSION = '0.5.0'
3
3
  end
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.3
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: 2017-08-05 00:00:00.000000000 Z
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.6.12
121
+ rubygems_version: 2.7.7
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: OSRM API for Ruby