known-countries 0.0.0 → 0.0.2
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 +4 -4
- data/CHANGES.md +3 -1
- data/README.md +41 -2
- data/VERSION +1 -1
- data/lib/known/countries.rb +201 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60f9b378ecceac55cd864a92193024057e61407a762c1bea8f1fb99ee7f0a52d
|
|
4
|
+
data.tar.gz: 03f864e9284fdd067892d17f8b9c3dd17732a91b4a2b42dd9009684775e3a14c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaf1aecf703121075487059651da08234f4543ccd0c9b93cead53735d7d143285f44e65242143ed378c6c33fae6863e729086dde56a24e57b40318e3dd2c3677
|
|
7
|
+
data.tar.gz: 508c48ffde5f6e63de01b32ab0324680bf81c73190a43fd51cac75056a3a934ba72b9d0d75bb0f593d5872fc00855aea66732d18c9acdafee6a2900b8e4bdc60
|
data/CHANGES.md
CHANGED
|
@@ -5,4 +5,6 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## 0.0.
|
|
8
|
+
## 0.0.2 - 2026-06-23
|
|
9
|
+
|
|
10
|
+
## 0.0.1 - 2026-06-22
|
data/README.md
CHANGED
|
@@ -5,16 +5,53 @@
|
|
|
5
5
|
[](https://rubygems.org/gems/known-countries)
|
|
6
6
|
[](https://rubydoc.info/gems/known-countries)
|
|
7
7
|
|
|
8
|
-
Well-known countries for Ruby
|
|
8
|
+
**Well-known countries for Ruby.**
|
|
9
|
+
|
|
10
|
+
<sub>
|
|
11
|
+
|
|
12
|
+
[[Features](#-features)] |
|
|
13
|
+
[[Prerequisites](#%EF%B8%8F-prerequisites)] |
|
|
14
|
+
[[Installation](#%EF%B8%8F-installation)] |
|
|
15
|
+
[[Examples](#-examples)] |
|
|
16
|
+
[[Reference](#-reference)] |
|
|
17
|
+
[[Development](#%E2%80%8D-development)]
|
|
18
|
+
|
|
19
|
+
</sub>
|
|
20
|
+
|
|
21
|
+
## ✨ Features
|
|
22
|
+
|
|
23
|
+
- Provides an enum of well-known countries (ISO 3166-1).
|
|
24
|
+
- 100% pure and safe Ruby with zero dependencies and no bloat.
|
|
25
|
+
- Cuts red tape: 100% free and unencumbered public domain software.
|
|
26
|
+
- Polyglot software also available for Dart, Python, and Rust.
|
|
27
|
+
|
|
28
|
+
## 🛠️ Prerequisites
|
|
29
|
+
|
|
30
|
+
- [Ruby] 3.2+
|
|
31
|
+
|
|
32
|
+
## ⬇️ Installation
|
|
33
|
+
|
|
34
|
+
### Installation from RubyGems
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
gem install known-countries
|
|
38
|
+
bundle add known-countries
|
|
39
|
+
```
|
|
9
40
|
|
|
10
41
|
## 👉 Examples
|
|
11
42
|
|
|
12
|
-
### Importing
|
|
43
|
+
### Importing the Library
|
|
13
44
|
|
|
14
45
|
```ruby
|
|
15
46
|
require 'known/countries'
|
|
47
|
+
|
|
48
|
+
include Known::Countries
|
|
16
49
|
```
|
|
17
50
|
|
|
51
|
+
## 📚 Reference
|
|
52
|
+
|
|
53
|
+
[rubydoc.info/gems/known-countries](https://rubydoc.info/gems/known-countries)
|
|
54
|
+
|
|
18
55
|
## 👨💻 Development
|
|
19
56
|
|
|
20
57
|
```bash
|
|
@@ -28,3 +65,5 @@ git clone https://github.com/it-is-known/known-countries.git
|
|
|
28
65
|
[](https://news.ycombinator.com/submitlink?u=https://github.com/it-is-known/known-countries&t=Known%20Countries)
|
|
29
66
|
[](https://www.facebook.com/sharer/sharer.php?u=https://github.com/it-is-known/known-countries)
|
|
30
67
|
[](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/it-is-known/known-countries)
|
|
68
|
+
|
|
69
|
+
[Ruby]: https://ruby-lang.org
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.2
|
data/lib/known/countries.rb
CHANGED
|
@@ -2,3 +2,204 @@
|
|
|
2
2
|
|
|
3
3
|
module Known; end
|
|
4
4
|
module Known::Countries; end
|
|
5
|
+
|
|
6
|
+
##
|
|
7
|
+
# A country (based on ISO 3166-1).
|
|
8
|
+
class Known::Countries::Country
|
|
9
|
+
##
|
|
10
|
+
# The country code (ISO 3166-1).
|
|
11
|
+
#
|
|
12
|
+
# @return [Symbol]
|
|
13
|
+
attr_reader :code
|
|
14
|
+
|
|
15
|
+
private_class_method :new
|
|
16
|
+
|
|
17
|
+
##
|
|
18
|
+
# Defines a new country.
|
|
19
|
+
#
|
|
20
|
+
# @param code [#to_sym] The country code (ISO 3166-1).
|
|
21
|
+
def initialize(code)
|
|
22
|
+
@code = code.to_sym
|
|
23
|
+
self.freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
##
|
|
27
|
+
# United Arab Emirates ("ae" in ISO 3166-1)
|
|
28
|
+
#
|
|
29
|
+
# @return [Country]
|
|
30
|
+
UNITED_ARAB_EMIRATES = new(:ae)
|
|
31
|
+
|
|
32
|
+
##
|
|
33
|
+
# Argentina ("ar" in ISO 3166-1)
|
|
34
|
+
#
|
|
35
|
+
# @return [Country]
|
|
36
|
+
ARGENTINA = new(:ar)
|
|
37
|
+
|
|
38
|
+
##
|
|
39
|
+
# Australia ("au" in ISO 3166-1)
|
|
40
|
+
#
|
|
41
|
+
# @return [Country]
|
|
42
|
+
AUSTRALIA = new(:au)
|
|
43
|
+
|
|
44
|
+
##
|
|
45
|
+
# Brazil ("br" in ISO 3166-1)
|
|
46
|
+
#
|
|
47
|
+
# @return [Country]
|
|
48
|
+
BRAZIL = new(:br)
|
|
49
|
+
|
|
50
|
+
##
|
|
51
|
+
# Canada ("ca" in ISO 3166-1)
|
|
52
|
+
#
|
|
53
|
+
# @return [Country]
|
|
54
|
+
CANADA = new(:ca)
|
|
55
|
+
|
|
56
|
+
##
|
|
57
|
+
# Switzerland ("ch" in ISO 3166-1)
|
|
58
|
+
#
|
|
59
|
+
# @return [Country]
|
|
60
|
+
SWITZERLAND = new(:ch)
|
|
61
|
+
|
|
62
|
+
##
|
|
63
|
+
# China ("cn" in ISO 3166-1)
|
|
64
|
+
#
|
|
65
|
+
# @return [Country]
|
|
66
|
+
CHINA = new(:cn)
|
|
67
|
+
|
|
68
|
+
##
|
|
69
|
+
# Germany ("de" in ISO 3166-1)
|
|
70
|
+
#
|
|
71
|
+
# @return [Country]
|
|
72
|
+
GERMANY = new(:de)
|
|
73
|
+
|
|
74
|
+
##
|
|
75
|
+
# Egypt ("eg" in ISO 3166-1)
|
|
76
|
+
#
|
|
77
|
+
# @return [Country]
|
|
78
|
+
EGYPT = new(:eg)
|
|
79
|
+
|
|
80
|
+
##
|
|
81
|
+
# Spain ("es" in ISO 3166-1)
|
|
82
|
+
#
|
|
83
|
+
# @return [Country]
|
|
84
|
+
SPAIN = new(:es)
|
|
85
|
+
|
|
86
|
+
##
|
|
87
|
+
# Finland ("fi" in ISO 3166-1)
|
|
88
|
+
#
|
|
89
|
+
# @return [Country]
|
|
90
|
+
FINLAND = new(:fi)
|
|
91
|
+
|
|
92
|
+
##
|
|
93
|
+
# France ("fr" in ISO 3166-1)
|
|
94
|
+
#
|
|
95
|
+
# @return [Country]
|
|
96
|
+
FRANCE = new(:fr)
|
|
97
|
+
|
|
98
|
+
##
|
|
99
|
+
# United Kingdom ("gb" in ISO 3166-1)
|
|
100
|
+
#
|
|
101
|
+
# @return [Country]
|
|
102
|
+
UNITED_KINGDOM = new(:gb)
|
|
103
|
+
|
|
104
|
+
##
|
|
105
|
+
# Greece ("gr" in ISO 3166-1)
|
|
106
|
+
#
|
|
107
|
+
# @return [Country]
|
|
108
|
+
GREECE = new(:gr)
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# India ("in" in ISO 3166-1)
|
|
112
|
+
#
|
|
113
|
+
# @return [Country]
|
|
114
|
+
INDIA = new(:in)
|
|
115
|
+
|
|
116
|
+
##
|
|
117
|
+
# Italy ("it" in ISO 3166-1)
|
|
118
|
+
#
|
|
119
|
+
# @return [Country]
|
|
120
|
+
ITALY = new(:it)
|
|
121
|
+
|
|
122
|
+
##
|
|
123
|
+
# Japan ("jp" in ISO 3166-1)
|
|
124
|
+
#
|
|
125
|
+
# @return [Country]
|
|
126
|
+
JAPAN = new(:jp)
|
|
127
|
+
|
|
128
|
+
##
|
|
129
|
+
# South Korea ("kr" in ISO 3166-1)
|
|
130
|
+
#
|
|
131
|
+
# @return [Country]
|
|
132
|
+
SOUTH_KOREA = new(:kr)
|
|
133
|
+
|
|
134
|
+
##
|
|
135
|
+
# Mexico ("mx" in ISO 3166-1)
|
|
136
|
+
#
|
|
137
|
+
# @return [Country]
|
|
138
|
+
MEXICO = new(:mx)
|
|
139
|
+
|
|
140
|
+
##
|
|
141
|
+
# Netherlands ("nl" in ISO 3166-1)
|
|
142
|
+
#
|
|
143
|
+
# @return [Country]
|
|
144
|
+
NETHERLANDS = new(:nl)
|
|
145
|
+
|
|
146
|
+
##
|
|
147
|
+
# Norway ("no" in ISO 3166-1)
|
|
148
|
+
#
|
|
149
|
+
# @return [Country]
|
|
150
|
+
NORWAY = new(:no)
|
|
151
|
+
|
|
152
|
+
##
|
|
153
|
+
# New Zealand ("nz" in ISO 3166-1)
|
|
154
|
+
#
|
|
155
|
+
# @return [Country]
|
|
156
|
+
NEW_ZEALAND = new(:nz)
|
|
157
|
+
|
|
158
|
+
##
|
|
159
|
+
# Poland ("pl" in ISO 3166-1)
|
|
160
|
+
#
|
|
161
|
+
# @return [Country]
|
|
162
|
+
POLAND = new(:pl)
|
|
163
|
+
|
|
164
|
+
##
|
|
165
|
+
# Saudi Arabia ("sa" in ISO 3166-1)
|
|
166
|
+
#
|
|
167
|
+
# @return [Country]
|
|
168
|
+
SAUDI_ARABIA = new(:sa)
|
|
169
|
+
|
|
170
|
+
##
|
|
171
|
+
# Sweden ("se" in ISO 3166-1)
|
|
172
|
+
#
|
|
173
|
+
# @return [Country]
|
|
174
|
+
SWEDEN = new(:se)
|
|
175
|
+
|
|
176
|
+
##
|
|
177
|
+
# Singapore ("sg" in ISO 3166-1)
|
|
178
|
+
#
|
|
179
|
+
# @return [Country]
|
|
180
|
+
SINGAPORE = new(:sg)
|
|
181
|
+
|
|
182
|
+
##
|
|
183
|
+
# Turkey ("tr" in ISO 3166-1)
|
|
184
|
+
#
|
|
185
|
+
# @return [Country]
|
|
186
|
+
TURKEY = new(:tr)
|
|
187
|
+
|
|
188
|
+
##
|
|
189
|
+
# Ukraine ("ua" in ISO 3166-1)
|
|
190
|
+
#
|
|
191
|
+
# @return [Country]
|
|
192
|
+
UKRAINE = new(:ua)
|
|
193
|
+
|
|
194
|
+
##
|
|
195
|
+
# United States ("us" in ISO 3166-1)
|
|
196
|
+
#
|
|
197
|
+
# @return [Country]
|
|
198
|
+
UNITED_STATES = new(:us)
|
|
199
|
+
|
|
200
|
+
##
|
|
201
|
+
# South Africa ("za" in ISO 3166-1)
|
|
202
|
+
#
|
|
203
|
+
# @return [Country]
|
|
204
|
+
SOUTH_AFRICA = new(:za)
|
|
205
|
+
end # Known::Countries::Country
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: known-countries
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arto Bendiken
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-06-23 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rspec
|