geo_names 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +9 -0
  5. data/CHANGELOG.md +9 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +8 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +75 -0
  10. data/Rakefile +8 -0
  11. data/bin/console +10 -0
  12. data/bin/setup +8 -0
  13. data/geo_names.gemspec +33 -0
  14. data/lib/geo_names.rb +69 -0
  15. data/lib/geo_names/address.rb +6 -0
  16. data/lib/geo_names/astergdem.rb +6 -0
  17. data/lib/geo_names/base.rb +110 -0
  18. data/lib/geo_names/children.rb +9 -0
  19. data/lib/geo_names/cities.rb +6 -0
  20. data/lib/geo_names/contains.rb +6 -0
  21. data/lib/geo_names/country_code.rb +6 -0
  22. data/lib/geo_names/country_info.rb +6 -0
  23. data/lib/geo_names/country_subdivision.rb +6 -0
  24. data/lib/geo_names/earthquakes.rb +6 -0
  25. data/lib/geo_names/extended_find_nearby.rb +6 -0
  26. data/lib/geo_names/find_near_by_weather.rb +6 -0
  27. data/lib/geo_names/find_nearby.rb +6 -0
  28. data/lib/geo_names/find_nearby_place_name.rb +6 -0
  29. data/lib/geo_names/find_nearby_po_is_osm.rb +6 -0
  30. data/lib/geo_names/find_nearby_postal_codes.rb +6 -0
  31. data/lib/geo_names/find_nearby_streets.rb +6 -0
  32. data/lib/geo_names/find_nearby_streets_osm.rb +6 -0
  33. data/lib/geo_names/find_nearby_wikipedia.rb +6 -0
  34. data/lib/geo_names/find_nearest_address.rb +6 -0
  35. data/lib/geo_names/find_nearest_intersection.rb +6 -0
  36. data/lib/geo_names/find_nearest_intersection_osm.rb +6 -0
  37. data/lib/geo_names/geo_code_address.rb +6 -0
  38. data/lib/geo_names/get.rb +6 -0
  39. data/lib/geo_names/gtopo30.rb +6 -0
  40. data/lib/geo_names/hierarchy.rb +6 -0
  41. data/lib/geo_names/neighbourhood.rb +6 -0
  42. data/lib/geo_names/neighbours.rb +6 -0
  43. data/lib/geo_names/ocean.rb +6 -0
  44. data/lib/geo_names/postal_code_country_info.rb +6 -0
  45. data/lib/geo_names/postal_code_lookup.rb +6 -0
  46. data/lib/geo_names/postal_code_search.rb +6 -0
  47. data/lib/geo_names/search.rb +6 -0
  48. data/lib/geo_names/siblings.rb +6 -0
  49. data/lib/geo_names/srtm1.rb +6 -0
  50. data/lib/geo_names/srtm3.rb +6 -0
  51. data/lib/geo_names/timezone.rb +6 -0
  52. data/lib/geo_names/version.rb +5 -0
  53. data/lib/geo_names/weather.rb +6 -0
  54. data/lib/geo_names/weather_icao.rb +6 -0
  55. data/lib/geo_names/wikipedia_bounding_box.rb +6 -0
  56. data/lib/geo_names/wikipedia_search.rb +6 -0
  57. metadata +183 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 14ae7a88699a7f9da9e21133ecd7f4be623e8d09880fca0f4903245843d155c9
4
+ data.tar.gz: 6ff3d387f57b564df264191a3768177ae2ad2871e8f33d26a5986cedec7b8e82
5
+ SHA512:
6
+ metadata.gz: cea416bf3108abf3ecd8702991d49937c253e0bd2084c7dabc17ad430453e12253302535e284fe1c7e83f00f6788351308e39685dd97879627df135dc099d134
7
+ data.tar.gz: ac5cb7abe2022d1ef328c355360e98c8ea17a0ec3eaacb63aa001924a8481ed80cc29d47db73d5550f543d73f1acd0a549edc33f9842b670c4c1d7e03fe21dae
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.4.5
7
+ - 2.5.3
8
+ - ruby-head
9
+ before_install: gem install bundler -v 1.16.5
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # CHANGELOG
2
+
3
+ ## Unreleased
4
+
5
+ - ...
6
+
7
+ ## 1.0.0
8
+
9
+ - First release
@@ -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 wakematta@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
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in geo_names.gemspec
8
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Mohamed Ziata
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,75 @@
1
+ # GeoNames
2
+
3
+ GeoNames Ruby API Wrapper
4
+
5
+ [![Build Status](https://travis-ci.org/WaKeMaTTa/geo_names.svg?branch=master)](https://travis-ci.org/WaKeMaTTa/geo_names)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/a69ae1a450119061f8e2/maintainability)](https://codeclimate.com/github/WaKeMaTTa/geo_names/maintainability)
7
+
8
+ This gem is a ruby API wrapper for [GeoNames](https://www.geonames.org/) [API's](https://www.geonames.org/export/web-services.html).
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'geo_names'
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ ```bash
21
+ $ bundle
22
+ ```
23
+
24
+ Or install it yourself as:
25
+
26
+ ```bash
27
+ $ gem install geo_names
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ### Pre-requirement
33
+
34
+ You need a valid `username` to use the gem. You can get it by signing up [here](http://www.geonames.org/login).
35
+
36
+ If you don't set the `username` it will *raises an exception*.
37
+
38
+ ### Configuration
39
+
40
+ You can use add initializer for example if you're on Rails.
41
+
42
+ ```ruby
43
+ # config/initializers/geo_names.rb
44
+
45
+ GeoNames.configure do |config|
46
+ config.username = ENV['GEONAMES_USERNAME']
47
+ end
48
+ ```
49
+
50
+ ### Searching
51
+
52
+ ```ruby
53
+ result = GeoNames::Search.search
54
+ # it returns a hash of the parsed JSON result
55
+ # or
56
+ # raise an exception if the parsed JSON contains an error status_code
57
+ ```
58
+
59
+ ## Development
60
+
61
+ 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.
62
+
63
+ 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).
64
+
65
+ ## Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at [geo_names repository](https://github.com/wakematta/geo_names). 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.
68
+
69
+ ## License
70
+
71
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
72
+
73
+ ## Code of Conduct
74
+
75
+ Everyone interacting in the GeoNames project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/geo_names/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'geo_names'
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
+ require 'pry'
10
+ Pry.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/geo_names.gemspec ADDED
@@ -0,0 +1,33 @@
1
+
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'geo_names/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'geo_names'
8
+ spec.version = GeoNames::VERSION
9
+ spec.authors = ['Mohamed Ziata']
10
+ spec.email = ['wakematta@gmail.com']
11
+
12
+ spec.summary = %q{An API wrapper for GeoNames API's}
13
+ spec.description = %q{A Gem to expose a wrapping API for the GeoNames API's}
14
+ spec.homepage = 'https://github.com/WaKeMaTTa/geo_names'
15
+ spec.license = 'MIT'
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
22
+ spec.bindir = 'exe'
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ['lib']
25
+
26
+ spec.add_runtime_dependency 'rest-client', '~> 2'
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.16'
29
+ spec.add_development_dependency 'gem-release', '~> 2.0'
30
+ spec.add_development_dependency 'pry-byebug', '~> 3.6'
31
+ spec.add_development_dependency 'rake', '~> 10.0'
32
+ spec.add_development_dependency 'rspec', '~> 3.0'
33
+ end
data/lib/geo_names.rb ADDED
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'geo_names/version'
4
+ require 'geo_names/base'
5
+ require 'geo_names/address'
6
+ require 'geo_names/astergdem'
7
+ require 'geo_names/children'
8
+ require 'geo_names/cities'
9
+ require 'geo_names/contains'
10
+ require 'geo_names/country_code'
11
+ require 'geo_names/country_info'
12
+ require 'geo_names/country_subdivision'
13
+ require 'geo_names/earthquakes'
14
+ require 'geo_names/extended_find_nearby'
15
+ require 'geo_names/find_nearby_place_name'
16
+ require 'geo_names/find_nearby_po_is_osm'
17
+ require 'geo_names/find_nearby_postal_codes'
18
+ require 'geo_names/find_nearby'
19
+ require 'geo_names/find_nearby_streets_osm'
20
+ require 'geo_names/find_nearby_streets'
21
+ require 'geo_names/find_near_by_weather'
22
+ require 'geo_names/find_nearby_wikipedia'
23
+ require 'geo_names/find_nearest_address'
24
+ require 'geo_names/find_nearest_intersection_osm'
25
+ require 'geo_names/find_nearest_intersection'
26
+ require 'geo_names/geo_code_address'
27
+ require 'geo_names/get'
28
+ require 'geo_names/gtopo30'
29
+ require 'geo_names/hierarchy'
30
+ require 'geo_names/neighbourhood'
31
+ require 'geo_names/neighbours'
32
+ require 'geo_names/ocean'
33
+ require 'geo_names/postal_code_country_info'
34
+ require 'geo_names/postal_code_lookup'
35
+ require 'geo_names/postal_code_search'
36
+ require 'geo_names/search'
37
+ require 'geo_names/siblings'
38
+ require 'geo_names/srtm1'
39
+ require 'geo_names/srtm3'
40
+ require 'geo_names/timezone'
41
+ require 'geo_names/version'
42
+ require 'geo_names/weather_icao'
43
+ require 'geo_names/weather'
44
+ require 'geo_names/wikipedia_bounding_box'
45
+ require 'geo_names/wikipedia_search'
46
+
47
+
48
+ module GeoNames
49
+ def self.configuration
50
+ @configuration ||= Configuration.new
51
+ end
52
+
53
+ def self.configure
54
+ self.configuration ||= Configuration.new
55
+ yield(configuration) if block_given?
56
+ end
57
+
58
+ # Main configuration class.
59
+ class Configuration
60
+ attr_accessor :api_base, :username
61
+
62
+ def initialize
63
+ @api_base = 'http://api.geonames.org/'
64
+ @usernname = nil
65
+ # @lang = nil
66
+ # @radius = nil
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Address < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Astergdem < Base
5
+ end
6
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+ require 'rest_client'
5
+
6
+ module GeoNames
7
+ class Base
8
+ attr_reader :url, :params
9
+
10
+ def self.search(params = {})
11
+ new(params).call
12
+ end
13
+
14
+ def initialize(params = {})
15
+ @url = "#{configuration.api_base}#{controller_name_for(self.class)}"
16
+ @params = {
17
+ username: configuration.username
18
+ }.merge(params)
19
+ end
20
+
21
+ def call
22
+ result = make_request
23
+ parse(result)
24
+ end
25
+
26
+ private
27
+
28
+ def configuration
29
+ @configuration ||= GeoNames.configuration
30
+ end
31
+
32
+ def make_request
33
+ RestClient.get(url, params: params)
34
+ end
35
+
36
+ def parse(json_string)
37
+ hash = JSON.parse(json_string)
38
+ return hash unless hash['status']
39
+
40
+ status_code = hash.dig('status', 'value')
41
+ message = hash.dig('status', 'message')
42
+ raise_error_according_to!(status_code, message)
43
+ end
44
+
45
+ def controller_name_for(klass)
46
+ name = klass.to_s.sub('GeoNames::', '')
47
+ name_camelized = name.chars.map.with_index do |char, index|
48
+ index.zero? ? char.downcase : char
49
+ end.join
50
+ "#{name_camelized}JSON"
51
+ end
52
+
53
+ def raise_error_according_to!(status_code, message)
54
+ case status_code
55
+ when 10
56
+ raise(AuthorizationExceptionError, message)
57
+ when 11
58
+ raise(RecordDoesNotExistError, message)
59
+ when 12
60
+ raise(OtherError, message)
61
+ when 13
62
+ raise(DatabaseTimeoutError, message)
63
+ when 13
64
+ raise(DatabaseTimeoutError, message)
65
+ when 14
66
+ raise(MissingOrInvalidParameterError, message)
67
+ when 15
68
+ raise(NoResultFoundrError, message)
69
+ when 16
70
+ raise(DuplicateExceptionError, message)
71
+ when 17
72
+ raise(PostalCodeNotFoundError, message)
73
+ when 18
74
+ raise(DailyLimitOfCreditsExceededError, message)
75
+ when 19
76
+ raise(HourlyLimitOfCreditsExceededError, message)
77
+ when 20
78
+ raise(WeeklyLimitOfCreditsExceededError, message)
79
+ when 21
80
+ raise(InvalidInputError, message)
81
+ when 22
82
+ raise(ServerOverloadedExceptionError, message)
83
+ when 23
84
+ raise(ServiceNotImplementedError, message)
85
+ when 24
86
+ raise(RadiusTooLargeError, message)
87
+ when 25
88
+ raise(MaxRowsTooLargeError, message)
89
+ else
90
+ raise(StatusCodeNotImplementedError, 'please report it in github.com/wakematta/geo_names')
91
+ end
92
+ end
93
+ end
94
+
95
+ class AuthorizationExceptionError < StandardError; end
96
+ class MissingOrInvalidParameterError < StandardError; end
97
+ class RecordDoesNotExistError < StandardError; end
98
+ class OtherError < StandardError; end
99
+ class NoResultFoundrError < StandardError; end
100
+ class PostalCodeNotFoundError < StandardError; end
101
+ class DailyLimitOfCreditsExceededError < StandardError; end
102
+ class HourlyLimitOfCreditsExceededError < StandardError; end
103
+ class WeeklyLimitOfCreditsExceededError < StandardError; end
104
+ class InvalidInputError < StandardError; end
105
+ class ServerOverloadedExceptionError < StandardError; end
106
+ class ServiceNotImplementedError < StandardError; end
107
+ class RadiusTooLargeError < StandardError; end
108
+ class MaxRowsTooLargeError < StandardError; end
109
+ class StatusCodeNotImplementedError < StandardError; end
110
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Children < Base
5
+ def required_param_names
6
+ %i[geonameId]
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Cities < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Contains < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class CountryCode < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class CountryInfo < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class CountrySubdivision < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Earthquakes < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class ExtendedFindNearby < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearByWeather < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearby < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearbyPlaceName < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearbyPOIsOSM < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearbyPostalCodes < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearbyStreets < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearbyStreetsOSM < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearbyWikipedia < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearestAddress < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearestIntersection < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class FindNearestIntersectionOSM < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class GeoCodeAddress < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Get < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Gtopo30 < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Hierarchy < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Neighbourhood < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Neighbours < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Ocean < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class PostalCodeCountryInfo < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class PostalCodeLookup < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class PostalCodeSearch < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Search < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Siblings < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Srtm1 < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Srtm3 < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Timezone < Base
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ VERSION = '1.0.0'
5
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class Weather < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class WeatherIcao < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class WikipediaBoundingBox < Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeoNames
4
+ class WikipediaSearch < Base
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,183 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: geo_names
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Mohamed Ziata
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-11-20 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: '2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2'
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.16'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ - !ruby/object:Gem::Dependency
42
+ name: gem-release
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry-byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ description: A Gem to expose a wrapping API for the GeoNames API's
98
+ email:
99
+ - wakematta@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
+ - CHANGELOG.md
108
+ - CODE_OF_CONDUCT.md
109
+ - Gemfile
110
+ - LICENSE.txt
111
+ - README.md
112
+ - Rakefile
113
+ - bin/console
114
+ - bin/setup
115
+ - geo_names.gemspec
116
+ - lib/geo_names.rb
117
+ - lib/geo_names/address.rb
118
+ - lib/geo_names/astergdem.rb
119
+ - lib/geo_names/base.rb
120
+ - lib/geo_names/children.rb
121
+ - lib/geo_names/cities.rb
122
+ - lib/geo_names/contains.rb
123
+ - lib/geo_names/country_code.rb
124
+ - lib/geo_names/country_info.rb
125
+ - lib/geo_names/country_subdivision.rb
126
+ - lib/geo_names/earthquakes.rb
127
+ - lib/geo_names/extended_find_nearby.rb
128
+ - lib/geo_names/find_near_by_weather.rb
129
+ - lib/geo_names/find_nearby.rb
130
+ - lib/geo_names/find_nearby_place_name.rb
131
+ - lib/geo_names/find_nearby_po_is_osm.rb
132
+ - lib/geo_names/find_nearby_postal_codes.rb
133
+ - lib/geo_names/find_nearby_streets.rb
134
+ - lib/geo_names/find_nearby_streets_osm.rb
135
+ - lib/geo_names/find_nearby_wikipedia.rb
136
+ - lib/geo_names/find_nearest_address.rb
137
+ - lib/geo_names/find_nearest_intersection.rb
138
+ - lib/geo_names/find_nearest_intersection_osm.rb
139
+ - lib/geo_names/geo_code_address.rb
140
+ - lib/geo_names/get.rb
141
+ - lib/geo_names/gtopo30.rb
142
+ - lib/geo_names/hierarchy.rb
143
+ - lib/geo_names/neighbourhood.rb
144
+ - lib/geo_names/neighbours.rb
145
+ - lib/geo_names/ocean.rb
146
+ - lib/geo_names/postal_code_country_info.rb
147
+ - lib/geo_names/postal_code_lookup.rb
148
+ - lib/geo_names/postal_code_search.rb
149
+ - lib/geo_names/search.rb
150
+ - lib/geo_names/siblings.rb
151
+ - lib/geo_names/srtm1.rb
152
+ - lib/geo_names/srtm3.rb
153
+ - lib/geo_names/timezone.rb
154
+ - lib/geo_names/version.rb
155
+ - lib/geo_names/weather.rb
156
+ - lib/geo_names/weather_icao.rb
157
+ - lib/geo_names/wikipedia_bounding_box.rb
158
+ - lib/geo_names/wikipedia_search.rb
159
+ homepage: https://github.com/WaKeMaTTa/geo_names
160
+ licenses:
161
+ - MIT
162
+ metadata: {}
163
+ post_install_message:
164
+ rdoc_options: []
165
+ require_paths:
166
+ - lib
167
+ required_ruby_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ requirements: []
178
+ rubyforge_project:
179
+ rubygems_version: 2.7.7
180
+ signing_key:
181
+ specification_version: 4
182
+ summary: An API wrapper for GeoNames API's
183
+ test_files: []