world_voyager 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4a4437cc5e519762a4ca9b1fd282f85a8e7b694cfd44ebbbcbdee4d45c9cd305
4
+ data.tar.gz: 4d772ffcd7312e8792bc8d7b74349b13ece7860a8de5eae30556594750f963fd
5
+ SHA512:
6
+ metadata.gz: d4854be9dde377fbe59ee7c99df4885dd365e3d9c0aa0dbce67e930c70eb733266b6a50701df47a649b140bae8a77089c374dde98a7ea4da60224d0bb699d361
7
+ data.tar.gz: 3b6ec71ba1fe686c0bdb376db3a8d08f209396c4bf166f77e045acca7b6bb528fb2b50aa52c79e61d486c528a83763d599625d0644f13e78be800cede2f97b45
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,88 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+
8
+ Layout/LineLength:
9
+ Exclude: ["db/migrate/*.rb"]
10
+
11
+ Layout/EmptyLinesAroundClassBody:
12
+ EnforcedStyle: empty_lines
13
+
14
+ Layout/EmptyLinesAroundModuleBody:
15
+ EnforcedStyle: empty_lines_except_namespace
16
+
17
+ Metrics/ModuleLength:
18
+ CountAsOne: ["array", "hash", "heredoc"]
19
+
20
+ Metrics/ClassLength:
21
+ Max: 150
22
+ CountAsOne: ["array", "hash", "heredoc"]
23
+
24
+ Metrics/MethodLength:
25
+ Max: 25
26
+ CountAsOne: ["array", "hash", "heredoc"]
27
+ Exclude:
28
+ - "config/routes/**/*.rb"
29
+ - "db/seeds/*.rb"
30
+
31
+ Metrics/AbcSize:
32
+ Enabled: false
33
+
34
+ Style/FrozenStringLiteralComment:
35
+ Enabled: false
36
+
37
+ Style/MethodCallWithArgsParentheses:
38
+ Enabled: false
39
+
40
+ Style/SignalException:
41
+ Enabled: false
42
+
43
+ Layout/IndentationConsistency:
44
+ EnforcedStyle: indented_internal_methods
45
+
46
+ Style/EmptyMethod:
47
+ EnforcedStyle: expanded
48
+
49
+ Style/SymbolArray:
50
+ EnforcedStyle: brackets
51
+
52
+ Style/WordArray:
53
+ EnforcedStyle: brackets
54
+
55
+ Metrics/BlockLength:
56
+ Exclude: ["config/**/*.rb"]
57
+
58
+ Metrics/CyclomaticComplexity:
59
+ Max: 18
60
+ Exclude: ["db/seeds/*.rb"]
61
+
62
+ Metrics/PerceivedComplexity:
63
+ Max: 20
64
+ Exclude: ["db/seeds/*.rb"]
65
+
66
+ Layout/MultilineMethodCallIndentation:
67
+ EnforcedStyle: indented
68
+
69
+ Layout/EndOfLine:
70
+ EnforcedStyle: lf
71
+
72
+ Style/NumericLiterals:
73
+ Strict: true
74
+
75
+ Layout/FirstArrayElementIndentation:
76
+ EnforcedStyle: consistent
77
+
78
+ Layout/EndAlignment:
79
+ EnforcedStyleAlignWith: start_of_line
80
+
81
+ Layout/CaseIndentation:
82
+ EnforcedStyle: end
83
+
84
+ Layout/FirstHashElementIndentation:
85
+ EnforcedStyle: consistent
86
+
87
+ Style/StringLiterals:
88
+ EnforcedStyle: single_quotes
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-11-24
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ruipbarata@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in world_voyager.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+
10
+ gem 'rspec', '~> 3.0'
11
+
12
+ gem 'rubocop', '~> 1.39'
13
+ gem 'rubocop-performance', '~> 1.15', '>= 1.15.1'
14
+ gem 'rubocop-rspec', '~> 2.15'
data/Gemfile.lock ADDED
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ world_voyager (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.5.0)
11
+ json (2.6.2)
12
+ parallel (1.22.1)
13
+ parser (3.1.2.1)
14
+ ast (~> 2.4.1)
15
+ rainbow (3.1.1)
16
+ rake (13.0.6)
17
+ regexp_parser (2.6.1)
18
+ rexml (3.2.5)
19
+ rspec (3.12.0)
20
+ rspec-core (~> 3.12.0)
21
+ rspec-expectations (~> 3.12.0)
22
+ rspec-mocks (~> 3.12.0)
23
+ rspec-core (3.12.0)
24
+ rspec-support (~> 3.12.0)
25
+ rspec-expectations (3.12.0)
26
+ diff-lcs (>= 1.2.0, < 2.0)
27
+ rspec-support (~> 3.12.0)
28
+ rspec-mocks (3.12.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-support (3.12.0)
32
+ rubocop (1.39.0)
33
+ json (~> 2.3)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.1.2.1)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml (>= 3.2.5, < 4.0)
39
+ rubocop-ast (>= 1.23.0, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 1.4.0, < 3.0)
42
+ rubocop-ast (1.23.0)
43
+ parser (>= 3.1.1.0)
44
+ rubocop-performance (1.15.1)
45
+ rubocop (>= 1.7.0, < 2.0)
46
+ rubocop-ast (>= 0.4.0)
47
+ rubocop-rspec (2.15.0)
48
+ rubocop (~> 1.33)
49
+ ruby-progressbar (1.11.0)
50
+ unicode-display_width (2.3.0)
51
+
52
+ PLATFORMS
53
+ x86_64-linux
54
+
55
+ DEPENDENCIES
56
+ rake (~> 13.0)
57
+ rspec (~> 3.0)
58
+ rubocop (~> 1.39)
59
+ rubocop-performance (~> 1.15, >= 1.15.1)
60
+ rubocop-rspec (~> 2.15)
61
+ world_voyager!
62
+
63
+ BUNDLED WITH
64
+ 2.3.25
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Rui Barata
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,46 @@
1
+ # WorldVoyager
2
+
3
+ Simple list of countries and cities around the world.
4
+
5
+ It uses [simplemaps](https://simplemaps.com/) database to provide a list of countries districts and cities around the world to use in your application.
6
+
7
+ ## Installation
8
+
9
+ Just install the `world_voyager` gem
10
+
11
+ ```sh
12
+ gem install world_voyager
13
+ ```
14
+
15
+ or if you use bundler put this in your `Gemfile`
16
+
17
+ ```ruby
18
+ gem 'world_voyager'
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ### List all countries of the world
24
+
25
+ ```ruby
26
+ WorldVoyager.countries
27
+ # => ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", ...]
28
+ ```
29
+
30
+ ### List all districts of specific country
31
+
32
+ ```ruby
33
+ WorldVoyager.districts("Portugal")
34
+ # => ["Aveiro", "Azores", "Beja", "Braga", "Bragança", ...]
35
+ ```
36
+
37
+ ### List all cities of specific district
38
+
39
+ ```ruby
40
+ WorldVoyager.cities("Coimbra")
41
+ # => ["Arganil", "Cantanhede", "Coimbra", "Condeixa-a-Nova", "Eiras", ...]
42
+ ```
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). Also, it uses [simplemaps](https://simplemaps.com/) open source database.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
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
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: [:spec, :rubocop]
@@ -0,0 +1,21 @@
1
+ This license is a legal document designed to protect your rights and the rights of the Pareto Software, LLC, the owner of Simplemaps.com. Please read it carefully. Purchasing or downloading a data product constitutes acceptance of this license.
2
+
3
+ Description of Product and Parties: This license is a contract between you (hereafter, the Customer) and Pareto Software, LLC (hereafter, the Provider) regarding the use and/or sale of an collection of geographic data (hereafter, the Database).
4
+
5
+ Ownership of Database: All rights to the Database are owned by the Provider. The Database is a cleaned and curated collection of geographic facts and the Provider retains all rights to the Database afforded by the law. Ownership of any intellectual property generated by the Provider while performing custom modifications to the Database for a Customer (with or without payment) is retained by the Provider.
6
+
7
+ License: Customers who purchase a license are allowed to use the database for projects that benefit their organization or that their organization oversees. Attribution is not required. The Customer is allowed to query the database to power privately or publicly facing applications. The Customer is allowed to make copies and backups of the data. The Customer may not publicly redistribute the Database without prior written permission. Customers can transfer their license to a third-party, at the sole discretion of the Provider, by submitting a request via email.
8
+
9
+ Free US Zip Code Database: The Provider offers a free version of the US Zip Code Database. This Database is offered free of charge conditional on a link back to https://simplemaps.com/data/us-zips. This backlink must come from a public webpage where the Customer is using the data. If the Customer uses the data internally, the backlink must be placed on the organization's website on a page that can be easily found though links on the root domain. The link must be clearly visible to the human eye. The backlink must be placed before the Customer uses the Database in production.
10
+
11
+ Free US Cities Database: The Provider offers a free version of the US Cities Database. This Database is offered free of charge conditional on a link back to https://simplemaps.com/data/us-cities. This backlink must come from a public webpage where the Customer is using the data. If the Customer uses the data internally, the backlink must be placed on the organization's website on a page that can be easily found though links on the root domain. The link must be clearly visible to the human eye. The backlink must be placed before the Customer uses the Database in production.
12
+
13
+ Basic World Cities Database: The Provider offers a Basic World Cities Database free of charge. This database is licensed under the Creative Commons Attribution 4.0 license as described at: https://creativecommons.org/licenses/by/4.0/.
14
+
15
+ Comprehensive and Pro World Cities Database Density Data: The Comprehensive and Pro World Cities Databases includes density estimates from The Center for International Earth Science Information Network - CIESIN - Columbia University. 2016. Gridded Population of the World, Version 4 (GPWv4): Population Count. Palisades, NY: NASA Socioeconomic Data and Applications Center (SEDAC). http://dx.doi.org/10.7927/H4X63JVC. Accessed June 2017. The density estimates are include under the Creative Commons Attribution 4.0 International License. The Provider places no additional restrictions on the use or distribution of the density data.
16
+
17
+ Guarantee: The Provider guarantees that for the period of thirty (30) days from the purchase of a License that the Customer shall, upon request, be refunded their actual purchase price within a reasonable period of time. The Customer acknowledges that receipt of a refund constitutes a termination of their License to use the Database. In the event of a Refund, the Customer promises to delete the Database immediately. Refunds after the period of thirty (30) days shall be at the sole discretion of the Provider.
18
+
19
+ LIMITATION OF LIABILITY: THE DATABASE IS SOLD "AS IS" AND "WITH ALL FAULTS". THE PROVIDER MAKES NO WARRANTY THAT IT IS FREE OF DEFECTS OR IS SUITABLE FOR ANY PARTICULAR PURPOSE. IN NO EVENT SHALL THE PROVIDER BE RESPONSIBLE FOR LOSS OR DAMAGES ARRISING FROM THE INSTALLATION OR USE OF THE DATABASE, INCLUDING BUT NOT LIMITED TO ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES. THE CUSTOMER IS SOLELY RESPONSIBLE FOR ENSURING THAT THEIR USE OF THE DATABASE IS IN ACCORDANCE WITH THE LAW OF THEIR JURISDICTION.
20
+
21
+ PROHIBITION OF ILLEGAL USE: USE OF THE DATABASE WHICH IS CONTRARY TO THE LAW IS PROHIBITED, AND IMMEDIATELY TERMINATES THE CUSTOMER'S LICENSE TO USE THE DATABASE.