heremaps 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +98 -0
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/heremaps.gemspec +39 -0
- data/lib/heremaps.rb +35 -0
- data/lib/heremaps/resources/base.rb +35 -0
- data/lib/heremaps/resources/geocoder/geocode.rb +16 -0
- data/lib/heremaps/resources/geocoder/landmark.rb +16 -0
- data/lib/heremaps/resources/geocoder/multi_reverse.rb +16 -0
- data/lib/heremaps/resources/geocoder/reverse.rb +16 -0
- data/lib/heremaps/resources/places/base.rb +16 -0
- data/lib/heremaps/resources/places/categories.rb +16 -0
- data/lib/heremaps/resources/places/discover/explore.rb +18 -0
- data/lib/heremaps/resources/places/discover/here.rb +18 -0
- data/lib/heremaps/resources/places/discover/search.rb +18 -0
- data/lib/heremaps/resources/places/suggest.rb +16 -0
- data/lib/heremaps/resources/routing/calculate.rb +16 -0
- data/lib/heremaps/resources/routing/calculate_isoline.rb +16 -0
- data/lib/heremaps/resources/routing/calculate_matrix.rb +16 -0
- data/lib/heremaps/resources/routing/get_route.rb +16 -0
- data/lib/heremaps/resources/routing/get_routing_zones.rb +16 -0
- data/lib/heremaps/version.rb +3 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 513297b00624a565758af0a14a3e7621fc478e9a579035dd2fee2beec9288e2d
|
4
|
+
data.tar.gz: 332da80fa8c3b3905e2becf224d4c9ea873222f846eb020a4dc01fb97c62dc49
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9cc9f57a1a4415a5986d153954665d1d8d1e5a26425b7507eb2669430707c00f267758b20028ca061c4f2e639eafce976e19f35226bdf20fbf51f24e004887c0
|
7
|
+
data.tar.gz: 150f6c5c7a2e9c735fb7e7a1b6b59cca45a6b94cc580b30e038e8e096a7606011874ad09a5054ee2ee0730762029e4aeefc425e8c9671b9bf15873e9057f4d1b
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at agrawal.dheeraj.7@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
heremaps (0.1.0)
|
5
|
+
rest-client
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.0)
|
11
|
+
backport (1.1.2)
|
12
|
+
debase (0.2.4.1)
|
13
|
+
debase-ruby_core_source (>= 0.10.2)
|
14
|
+
debase-ruby_core_source (0.10.5)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
domain_name (0.5.20190701)
|
17
|
+
unf (>= 0.0.5, < 1.0.0)
|
18
|
+
htmlentities (4.3.4)
|
19
|
+
http-accept (1.7.0)
|
20
|
+
http-cookie (1.0.3)
|
21
|
+
domain_name (~> 0.5)
|
22
|
+
jaro_winkler (1.5.3)
|
23
|
+
mime-types (3.3)
|
24
|
+
mime-types-data (~> 3.2015)
|
25
|
+
mime-types-data (3.2019.0904)
|
26
|
+
mini_portile2 (2.4.0)
|
27
|
+
netrc (0.11.0)
|
28
|
+
nokogiri (1.10.4)
|
29
|
+
mini_portile2 (~> 2.4.0)
|
30
|
+
parallel (1.17.0)
|
31
|
+
parser (2.6.4.1)
|
32
|
+
ast (~> 2.4.0)
|
33
|
+
rainbow (3.0.0)
|
34
|
+
rake (10.5.0)
|
35
|
+
rest-client (2.1.0)
|
36
|
+
http-accept (>= 1.7.0, < 2.0)
|
37
|
+
http-cookie (>= 1.0.2, < 2.0)
|
38
|
+
mime-types (>= 1.16, < 4.0)
|
39
|
+
netrc (~> 0.8)
|
40
|
+
reverse_markdown (1.3.0)
|
41
|
+
nokogiri
|
42
|
+
rspec (3.8.0)
|
43
|
+
rspec-core (~> 3.8.0)
|
44
|
+
rspec-expectations (~> 3.8.0)
|
45
|
+
rspec-mocks (~> 3.8.0)
|
46
|
+
rspec-core (3.8.2)
|
47
|
+
rspec-support (~> 3.8.0)
|
48
|
+
rspec-expectations (3.8.4)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.8.0)
|
51
|
+
rspec-mocks (3.8.1)
|
52
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
53
|
+
rspec-support (~> 3.8.0)
|
54
|
+
rspec-support (3.8.2)
|
55
|
+
rubocop (0.74.0)
|
56
|
+
jaro_winkler (~> 1.5.1)
|
57
|
+
parallel (~> 1.10)
|
58
|
+
parser (>= 2.6)
|
59
|
+
rainbow (>= 2.2.2, < 4.0)
|
60
|
+
ruby-progressbar (~> 1.7)
|
61
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
62
|
+
ruby-debug-ide (0.7.0)
|
63
|
+
rake (>= 0.8.1)
|
64
|
+
ruby-progressbar (1.10.1)
|
65
|
+
solargraph (0.37.2)
|
66
|
+
backport (~> 1.1)
|
67
|
+
bundler (>= 1.17.2)
|
68
|
+
htmlentities (~> 4.3, >= 4.3.4)
|
69
|
+
jaro_winkler (~> 1.5)
|
70
|
+
nokogiri (~> 1.9, >= 1.9.1)
|
71
|
+
parser (~> 2.3)
|
72
|
+
reverse_markdown (~> 1.0, >= 1.0.5)
|
73
|
+
rubocop (~> 0.52)
|
74
|
+
thor (~> 0.19, >= 0.19.4)
|
75
|
+
tilt (~> 2.0)
|
76
|
+
yard (~> 0.9)
|
77
|
+
thor (0.20.3)
|
78
|
+
tilt (2.0.9)
|
79
|
+
unf (0.1.4)
|
80
|
+
unf_ext
|
81
|
+
unf_ext (0.0.7.6)
|
82
|
+
unicode-display_width (1.6.0)
|
83
|
+
yard (0.9.20)
|
84
|
+
|
85
|
+
PLATFORMS
|
86
|
+
ruby
|
87
|
+
|
88
|
+
DEPENDENCIES
|
89
|
+
bundler (~> 1.17)
|
90
|
+
debase (~> 0.2.4.1)
|
91
|
+
heremaps!
|
92
|
+
rake (~> 10.0)
|
93
|
+
rspec (~> 3.8.0)
|
94
|
+
ruby-debug-ide (~> 0.7.0)
|
95
|
+
solargraph (~> 0.37.2)
|
96
|
+
|
97
|
+
BUNDLED WITH
|
98
|
+
1.17.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Dheeraj (DJ) Agrawal
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# Heremaps
|
2
|
+
|
3
|
+
This `ruby gem` provide the functionality to integrate with HERE Maps API, as described below.
|
4
|
+
|
5
|
+
APIs Currently Integrated
|
6
|
+
|
7
|
+
- SEARCH (PLACES) AND GEOCODING APIs
|
8
|
+
- ROUTING APIs
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```bash
|
15
|
+
cmd> gem 'heremaps'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
cmd> bundle
|
22
|
+
```
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
cmd> gem install heremaps
|
27
|
+
```
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
To initialize the Heremaps library, you must generate the Heremaps APP ID and APP CODE. And set it as shown below
|
31
|
+
```ruby
|
32
|
+
require "heremaps"
|
33
|
+
...
|
34
|
+
Heremaps.app_id = "<app_id>"
|
35
|
+
Heremaps.app_code = "<app_code>"
|
36
|
+
```
|
37
|
+
### Calling Heremap API
|
38
|
+
|
39
|
+
To use Heremaps under `spec` folder, please refer to RSpec. Following is an example to invoke geocoder API.
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require "heremaps"
|
43
|
+
...
|
44
|
+
options = { :searchtext => "425 W Randolph Street, Chicago", :gen => 9 }
|
45
|
+
res = Heremaps::Geocoder::Geocode.new.get options
|
46
|
+
...
|
47
|
+
```
|
48
|
+
|
49
|
+
## Development
|
50
|
+
|
51
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
52
|
+
|
53
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
54
|
+
|
55
|
+
## Contributing
|
56
|
+
|
57
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/agrawald/heremaps. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
58
|
+
|
59
|
+
## License
|
60
|
+
|
61
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
62
|
+
|
63
|
+
## Code of Conduct
|
64
|
+
|
65
|
+
Everyone interacting in the Heremaps project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/heremaps/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "heremaps"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/heremaps.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "heremaps/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "heremaps"
|
7
|
+
spec.version = Heremaps::VERSION
|
8
|
+
spec.authors = ["Dheeraj (DJ) Agrawal"]
|
9
|
+
spec.email = ["agrawal.dheeraj.7@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "A Ruby gem to integrate with Heremaps API"
|
12
|
+
spec.description = "This `ruby gem` provide the functionality to integrate with HERE Maps API, SEARCH (PLACES) AND GEOCODING APIs
|
13
|
+
- ROUTING APIs"
|
14
|
+
spec.homepage = "http://github.com/agrawald/heremaps"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
else
|
20
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
21
|
+
end
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
spec.add_runtime_dependency "rest-client"
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
34
|
+
spec.add_development_dependency "debase", "~> 0.2.4.1"
|
35
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.8.0"
|
37
|
+
spec.add_development_dependency "ruby-debug-ide", "~> 0.7.0"
|
38
|
+
spec.add_development_dependency "solargraph", "~> 0.37.2"
|
39
|
+
end
|
data/lib/heremaps.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require "heremaps/version"
|
2
|
+
|
3
|
+
module Heremaps
|
4
|
+
class Error < StandardError; end
|
5
|
+
|
6
|
+
# Your code goes here...
|
7
|
+
|
8
|
+
require "rest-client"
|
9
|
+
require "heremaps/resources/base"
|
10
|
+
|
11
|
+
# geocoder APIs
|
12
|
+
require "heremaps/resources/geocoder/geocode"
|
13
|
+
require "heremaps/resources/geocoder/landmark"
|
14
|
+
require "heremaps/resources/geocoder/multi_reverse"
|
15
|
+
require "heremaps/resources/geocoder/reverse"
|
16
|
+
|
17
|
+
# places APIs
|
18
|
+
require "heremaps/resources/places/base"
|
19
|
+
require "heremaps/resources/places/categories"
|
20
|
+
require "heremaps/resources/places/suggest"
|
21
|
+
require "heremaps/resources/places/discover/search"
|
22
|
+
require "heremaps/resources/places/discover/here"
|
23
|
+
require "heremaps/resources/places/discover/explore"
|
24
|
+
|
25
|
+
# routing APIs
|
26
|
+
require "heremaps/resources/routing/calculate"
|
27
|
+
require "heremaps/resources/routing/calculate_isoline"
|
28
|
+
require "heremaps/resources/routing/calculate_matrix"
|
29
|
+
require "heremaps/resources/routing/get_route"
|
30
|
+
require "heremaps/resources/routing/get_routing_zones"
|
31
|
+
|
32
|
+
class << self
|
33
|
+
attr_accessor :app_id, :app_code, :env
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Heremaps
|
2
|
+
class Base
|
3
|
+
attr_accessor :method_name, :base_url, :test_url, :path
|
4
|
+
|
5
|
+
def request_url(format: "json")
|
6
|
+
format ||= "json"
|
7
|
+
url = (Heremaps.env == "test") ? test_url : base_url
|
8
|
+
url = File.join(url, path, "#{method_name}.#{format}")
|
9
|
+
url
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(options = {})
|
13
|
+
res = RestClient.get(request_url(:format => options[:format]), :params => prepare_the_request(options))
|
14
|
+
res
|
15
|
+
end
|
16
|
+
|
17
|
+
def prepare_the_request(options = {})
|
18
|
+
options = options.merge(:app_id => Heremaps.app_id, :app_code => Heremaps.app_code)
|
19
|
+
options
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get(options = {})
|
23
|
+
new.get(options)
|
24
|
+
end
|
25
|
+
|
26
|
+
# direct call to instance methods as class methods.
|
27
|
+
def response_to_missing?(method_sym, *arg, &block)
|
28
|
+
if instance_methods.include?(method_sym)
|
29
|
+
new.send(method_sym, *arg, &block)
|
30
|
+
else
|
31
|
+
super
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Geocoder
|
3
|
+
class Geocode < Heremaps::Base
|
4
|
+
BASE_URL = "https://geocoder.api.here.com".freeze
|
5
|
+
TEST_URL = "https://geocoder.cit.api.here.com".freeze
|
6
|
+
PATH = "/6.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "geocode".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Geocoder
|
3
|
+
class Landmark < Heremaps::Base
|
4
|
+
BASE_URL = "https://geocoder.api.here.com".freeze
|
5
|
+
TEST_URL = "http://geocoder.cit.api.here.com".freeze
|
6
|
+
PATH = "/6.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "search".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Geocoder
|
3
|
+
class MultiReverse < Heremaps::Base
|
4
|
+
BASE_URL = "https://reverse.geocoder.api.here.com".freeze
|
5
|
+
TEST_URL = "http://reverse.geocoder.cit.api.here.com".freeze
|
6
|
+
PATH = "/6.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "multi-reversegeocode".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Geocoder
|
3
|
+
class Reverse < Heremaps::Base
|
4
|
+
BASE_URL = "https://reverse.geocoder.api.here.com".freeze
|
5
|
+
TEST_URL = "http://reverse.geocoder.cit.api.here.com".freeze
|
6
|
+
PATH = "/6.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "reversegeocode".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Places
|
3
|
+
class Base < Heremaps::Base
|
4
|
+
def request_url
|
5
|
+
url = (Heremaps.env == "test") ? test_url : base_url
|
6
|
+
url = File.join(url, path, method_name.to_s)
|
7
|
+
url
|
8
|
+
end
|
9
|
+
|
10
|
+
def get(options = {}, headers = {})
|
11
|
+
res = RestClient::Request.execute(:method => :get, :url => request_url, :headers => headers.merge(:params => prepare_the_request(options)))
|
12
|
+
res
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Places
|
3
|
+
class Categories < Base
|
4
|
+
BASE_URL = "https://places.api.here.com/places".freeze
|
5
|
+
TEST_URL = "https://places.cit.api.here.com".freeze
|
6
|
+
PATH = "/v1/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "categories/places".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Places
|
3
|
+
module Discover
|
4
|
+
class Explore < Base
|
5
|
+
BASE_URL = "https://places.api.here.com/places".freeze
|
6
|
+
TEST_URL = "https://places.cit.api.here.com".freeze
|
7
|
+
PATH = "/v1/".freeze
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@base_url = BASE_URL
|
11
|
+
@test_url = TEST_URL
|
12
|
+
@path = PATH
|
13
|
+
@method_name = "discover/explore".freeze # getroute as default method.
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Places
|
3
|
+
module Discover
|
4
|
+
class Here < Base
|
5
|
+
BASE_URL = "https://places.api.here.com/places".freeze
|
6
|
+
TEST_URL = "https://places.cit.api.here.com".freeze
|
7
|
+
PATH = "/v1/".freeze
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@base_url = BASE_URL
|
11
|
+
@test_url = TEST_URL
|
12
|
+
@path = PATH
|
13
|
+
@method_name = "discover/here".freeze # getroute as default method.
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Places
|
3
|
+
module Discover
|
4
|
+
class Search < Base
|
5
|
+
BASE_URL = "https://places.api.here.com/places".freeze
|
6
|
+
TEST_URL = "https://places.cit.api.here.com".freeze
|
7
|
+
PATH = "/v1/".freeze
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@base_url = BASE_URL
|
11
|
+
@test_url = TEST_URL
|
12
|
+
@path = PATH
|
13
|
+
@method_name = "discover/search".freeze # getroute as default method.
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Places
|
3
|
+
class Suggest < Base
|
4
|
+
BASE_URL = "https://places.api.here.com/places".freeze
|
5
|
+
TEST_URL = "https://places.cit.api.here.com".freeze
|
6
|
+
PATH = "/v1/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "suggest".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Routing
|
3
|
+
class Calculate < Heremaps::Base
|
4
|
+
BASE_URL = "https://route.api.here.com/routing".freeze
|
5
|
+
TEST_URL = "https://route.cit.api.here.com/routing".freeze
|
6
|
+
PATH = "/7.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "calculateroute".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Routing
|
3
|
+
class CalculateIsoline < Heremaps::Base
|
4
|
+
BASE_URL = "https://isoline.route.api.here.com/routing".freeze
|
5
|
+
TEST_URL = "https://isoline.cit.route.api.here.com/routing".freeze
|
6
|
+
PATH = "/7.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "calculateisoline".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Routing
|
3
|
+
class CalculateMatrix < Heremaps::Base
|
4
|
+
BASE_URL = "https://matrix.route.api.here.com/routing".freeze
|
5
|
+
TEST_URL = "https://matrix.cit.route.api.here.com/routing".freeze
|
6
|
+
PATH = "/7.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "calculatematrix".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Routing
|
3
|
+
class GetRoute < Heremaps::Base
|
4
|
+
BASE_URL = "https://route.api.here.com/routing".freeze
|
5
|
+
TEST_URL = "https://route.cit.api.here.com/routing".freeze
|
6
|
+
PATH = "/7.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "getroute".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heremaps
|
2
|
+
module Routing
|
3
|
+
class GetRouteZones < Heremaps::Base
|
4
|
+
BASE_URL = "https://route.api.here.com/routing".freeze
|
5
|
+
TEST_URL = "https://route.cit.api.here.com/routing".freeze
|
6
|
+
PATH = "/7.2/".freeze
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@base_url = BASE_URL
|
10
|
+
@test_url = TEST_URL
|
11
|
+
@path = PATH
|
12
|
+
@method_name = "getroutingzones".freeze # getroute as default method.
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: heremaps
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dheeraj (DJ) Agrawal
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.17'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.17'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: debase
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.2.4.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.2.4.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.8.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: ruby-debug-ide
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.7.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.7.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: solargraph
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.37.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.37.2
|
111
|
+
description: |-
|
112
|
+
This `ruby gem` provide the functionality to integrate with HERE Maps API, SEARCH (PLACES) AND GEOCODING APIs
|
113
|
+
- ROUTING APIs
|
114
|
+
email:
|
115
|
+
- agrawal.dheeraj.7@gmail.com
|
116
|
+
executables: []
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- ".gitignore"
|
121
|
+
- ".rspec"
|
122
|
+
- ".travis.yml"
|
123
|
+
- CODE_OF_CONDUCT.md
|
124
|
+
- Gemfile
|
125
|
+
- Gemfile.lock
|
126
|
+
- LICENSE.txt
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- bin/console
|
130
|
+
- bin/setup
|
131
|
+
- heremaps.gemspec
|
132
|
+
- lib/heremaps.rb
|
133
|
+
- lib/heremaps/resources/base.rb
|
134
|
+
- lib/heremaps/resources/geocoder/geocode.rb
|
135
|
+
- lib/heremaps/resources/geocoder/landmark.rb
|
136
|
+
- lib/heremaps/resources/geocoder/multi_reverse.rb
|
137
|
+
- lib/heremaps/resources/geocoder/reverse.rb
|
138
|
+
- lib/heremaps/resources/places/base.rb
|
139
|
+
- lib/heremaps/resources/places/categories.rb
|
140
|
+
- lib/heremaps/resources/places/discover/explore.rb
|
141
|
+
- lib/heremaps/resources/places/discover/here.rb
|
142
|
+
- lib/heremaps/resources/places/discover/search.rb
|
143
|
+
- lib/heremaps/resources/places/suggest.rb
|
144
|
+
- lib/heremaps/resources/routing/calculate.rb
|
145
|
+
- lib/heremaps/resources/routing/calculate_isoline.rb
|
146
|
+
- lib/heremaps/resources/routing/calculate_matrix.rb
|
147
|
+
- lib/heremaps/resources/routing/get_route.rb
|
148
|
+
- lib/heremaps/resources/routing/get_routing_zones.rb
|
149
|
+
- lib/heremaps/version.rb
|
150
|
+
homepage: http://github.com/agrawald/heremaps
|
151
|
+
licenses:
|
152
|
+
- MIT
|
153
|
+
metadata:
|
154
|
+
allowed_push_host: https://rubygems.org
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubygems_version: 3.0.3
|
171
|
+
signing_key:
|
172
|
+
specification_version: 4
|
173
|
+
summary: A Ruby gem to integrate with Heremaps API
|
174
|
+
test_files: []
|