geocoder_here_maps 0.2.0 → 0.3.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: 93381dfd6734e4661e3de0282bedc8c00fb7fc98
4
- data.tar.gz: a8ae075605a5bb0bbc97586eaa9655d7dcd6efd4
2
+ SHA256:
3
+ metadata.gz: 1fc5c1a91f69e4a4cb0779ea0d66a2f7204c0d668306e3b58b42f2dbfd4c7e79
4
+ data.tar.gz: 25cf03d9542f84e9542a8ee6c6ab7c12c75f665da1774c5fae4cdfe880f6acd3
5
5
  SHA512:
6
- metadata.gz: 620c2318236c37f907bc3ebcb33017e3f3676f2bd3f7547540738d339fb0f836b910227f6dd9fb2a936fe7a8070c088a8443219725fae5d1a3f1c33dd7f065bf
7
- data.tar.gz: 854a8f3a9c7c6d98839b04d83cc41de3150dff7979e08dc9c7c9148abaaa02761c80e98ae8dde7032942c030d327f13778c8d19f74ee540480c187a01ee325ef
6
+ metadata.gz: 2b8eab15f2f173fad56b4a58f125a55065848ce7c2e0b819956ffde0166cd688db82a9eecc6e8d0aca6b2d19c4c2dc4fc9d4bd395c62c9f284a72491af0fe3d6
7
+ data.tar.gz: 7a5fc7baa4510b40867c08f0277d16984ef97901cc1693876b5ff18fb70024d52cf9f1dc2a27f2f4f833b5c2ec7485499b066c5c4f7338bdb48a654484c9323e
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geocoder_here_maps (0.2.0)
5
- geocoder (~> 1.5.1)
4
+ geocoder_here_maps (0.3.0)
5
+ geocoder (>= 1.5.1, < 1.7.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  diff-lcs (1.3)
11
- geocoder (1.5.1)
11
+ geocoder (1.6.3)
12
12
  rake (10.5.0)
13
13
  rspec (3.8.0)
14
14
  rspec-core (~> 3.8.0)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GeocoderHereMaps
2
2
 
3
- An "extension" for [`geocoder`](https://github.com/alexreisner/geocoder) which adds support to use here maps [`Autocomplete`](https://developer.here.com/documentation/geocoder-autocomplete/topics/quick-start-get-suggestions.html) api with `geocoder`
3
+ An "extension" for [`geocoder`](https://github.com/alexreisner/geocoder) which adds support for using additional HERE maps APIs.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,7 +20,24 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ Geocoding and reverse geocoding will work in the same way as provided by `geocoder` gem.
24
+
25
+ To use autocomplete API
26
+
27
+ ```ruby
28
+ Geocoder.search('Delhi', lookup: :here_suggest)
29
+ ```
30
+
31
+ To use calculateroute API
32
+
33
+ ```ruby
34
+ Geocoder.search([[26.1215649, -80.1273346], [34.8440896, -82.4057]],
35
+ lookup: :here_calculate_route,
36
+ params: { mode: 'fastest;truck', departure: "now", routeattributes: 'shape'}).first
37
+ ```
38
+
39
+
40
+ If multiple lookups are used in application no need to define separate configuration for these new lookups in `geocoder.rb`. They will use the configuration defined for here maps.
24
41
 
25
42
  ## Development
26
43
 
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.0"
28
28
 
29
- spec.add_dependency "geocoder", "~> 1.5.1"
29
+ spec.add_dependency "geocoder", ">= 1.5.1", "< 1.7.0"
30
30
  end
@@ -7,37 +7,24 @@ module Geocoder::Lookup
7
7
  end
8
8
 
9
9
  def required_api_key_parts
10
- ["app_id", "app_code"]
10
+ ["api_key"]
11
+ end
12
+
13
+ def supported_protocols
14
+ [:https]
11
15
  end
12
16
 
13
17
  private
14
18
 
15
19
  def query_url_here_options(query)
16
20
  options = {
17
- app_id: api_key,
18
- app_code: api_code,
21
+ apikey: configuration.api_key,
19
22
  language: (query.language || configuration.language)
20
23
  }
21
24
  end
22
25
 
23
- def api_key
24
- if (a = configuration.api_key)
25
- return a.first if a.is_a?(Array)
26
- end
27
- end
28
-
29
- def api_code
30
- if (a = configuration.api_key)
31
- return a.last if a.is_a?(Array)
32
- end
33
- end
34
-
35
26
  def domain
36
- if configuration.cit
37
- 'cit.api.here.com'
38
- else
39
- 'api.here.com'
40
- end
27
+ 'ls.hereapi.com'
41
28
  end
42
29
  end
43
30
  end
@@ -1,3 +1,3 @@
1
1
  module GeocoderHereMaps
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geocoder_here_maps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arpit Jain
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-05 00:00:00.000000000 Z
11
+ date: 2020-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,22 @@ dependencies:
56
56
  name: geocoder
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.5.1
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: 1.7.0
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: 1.5.1
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: 1.7.0
69
75
  description:
70
76
  email:
71
77
  - arpit@bigbinary.com
@@ -114,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
120
  - !ruby/object:Gem::Version
115
121
  version: '0'
116
122
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.5.2.3
123
+ rubygems_version: 3.0.6
119
124
  signing_key:
120
125
  specification_version: 4
121
126
  summary: Extends geocoder for HERE maps.