countries 5.1.2 → 5.2.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 +4 -4
- data/.github/workflows/tests.yml +1 -1
- data/CHANGELOG.md +22 -1
- data/README.markdown +1 -1
- data/countries.gemspec +1 -1
- data/lib/countries/cache/countries.json +1 -1
- data/lib/countries/cache/locales/ab.json +1 -1
- data/lib/countries/cache/locales/ak.json +1 -1
- data/lib/countries/cache/locales/an.json +1 -1
- data/lib/countries/cache/locales/ay.json +1 -1
- data/lib/countries/cache/locales/ba.json +1 -1
- data/lib/countries/cache/locales/bi.json +1 -1
- data/lib/countries/cache/locales/ch.json +1 -1
- data/lib/countries/cache/locales/de.json +1 -1
- data/lib/countries/cache/locales/ee.json +1 -1
- data/lib/countries/cache/locales/en.json +1 -1
- data/lib/countries/cache/locales/fr.json +1 -1
- data/lib/countries/cache/locales/gn.json +1 -1
- data/lib/countries/cache/locales/ki.json +1 -1
- data/lib/countries/cache/locales/kl.json +1 -1
- data/lib/countries/cache/locales/lt.json +1 -1
- data/lib/countries/cache/locales/sd.json +1 -1
- data/lib/countries/cache/locales/sw.json +1 -1
- data/lib/countries/cache/locales/tl.json +1 -1
- data/lib/countries/cache/locales/ve.json +1 -1
- data/lib/countries/cache/locales/xh.json +1 -1
- data/lib/countries/country/class_methods.rb +3 -3
- data/lib/countries/country.rb +1 -1
- data/lib/countries/data/countries/TR.yaml +2 -2
- data/lib/countries/data/countries/TW.yaml +14 -12
- data/lib/countries/data/translations/countries-ab.yaml +1 -1
- data/lib/countries/data/translations/countries-ak.yaml +1 -1
- data/lib/countries/data/translations/countries-an.yaml +1 -1
- data/lib/countries/data/translations/countries-ay.yaml +1 -1
- data/lib/countries/data/translations/countries-ba.yaml +1 -1
- data/lib/countries/data/translations/countries-bi.yaml +1 -1
- data/lib/countries/data/translations/countries-ch.yaml +1 -1
- data/lib/countries/data/translations/countries-de.yaml +2 -2
- data/lib/countries/data/translations/countries-ee.yaml +1 -1
- data/lib/countries/data/translations/countries-en.yaml +1 -1
- data/lib/countries/data/translations/countries-fr.yaml +7 -7
- data/lib/countries/data/translations/countries-gn.yaml +1 -1
- data/lib/countries/data/translations/countries-ki.yaml +1 -1
- data/lib/countries/data/translations/countries-kl.yaml +1 -1
- data/lib/countries/data/translations/countries-lt.yaml +1 -1
- data/lib/countries/data/translations/countries-sd.yaml +1 -1
- data/lib/countries/data/translations/countries-sw.yaml +1 -1
- data/lib/countries/data/translations/countries-tl.yaml +1 -1
- data/lib/countries/data/translations/countries-ve.yaml +1 -1
- data/lib/countries/data/translations/countries-xh.yaml +1 -1
- data/lib/countries/version.rb +1 -1
- data/lib/countries.rb +0 -2
- data/spec/country_spec.rb +46 -6
- metadata +5 -5
|
@@ -47,7 +47,7 @@ CF: République centrafricaine
|
|
|
47
47
|
CG: République du Congo
|
|
48
48
|
CH: Suisse
|
|
49
49
|
CI: Côte d'Ivoire
|
|
50
|
-
CK:
|
|
50
|
+
CK: Îles Cook
|
|
51
51
|
CL: Chili
|
|
52
52
|
CM: Cameroun
|
|
53
53
|
CN: Chine
|
|
@@ -76,7 +76,7 @@ FI: Finlande
|
|
|
76
76
|
FJ: Fidji
|
|
77
77
|
FK: Malouines, Îles (Falkland)
|
|
78
78
|
FM: Micronésie, États fédérés de
|
|
79
|
-
FO:
|
|
79
|
+
FO: Îles Féroé
|
|
80
80
|
FR: France
|
|
81
81
|
GA: Gabon
|
|
82
82
|
GB: Royaume-Uni
|
|
@@ -98,7 +98,7 @@ GU: Guam
|
|
|
98
98
|
GW: Guinée-Bissau
|
|
99
99
|
GY: Guyana
|
|
100
100
|
HK: Hong Kong
|
|
101
|
-
HM:
|
|
101
|
+
HM: Îles Heard-et-MacDonald
|
|
102
102
|
HN: Honduras
|
|
103
103
|
HR: Croatie
|
|
104
104
|
HT: Haïti
|
|
@@ -126,7 +126,7 @@ KN: Saint-Christophe-et-Niévès
|
|
|
126
126
|
KP: Corée du Nord
|
|
127
127
|
KR: Corée du Sud
|
|
128
128
|
KW: Koweït
|
|
129
|
-
KY:
|
|
129
|
+
KY: Îles Caïmans
|
|
130
130
|
KZ: Kazakhstan
|
|
131
131
|
LA: Lao, République démocratique populaire
|
|
132
132
|
LB: Liban
|
|
@@ -165,7 +165,7 @@ MZ: Mozambique
|
|
|
165
165
|
NA: Namibie
|
|
166
166
|
NC: Nouvelle-Calédonie
|
|
167
167
|
NE: Niger
|
|
168
|
-
NF:
|
|
168
|
+
NF: Île Norfolk
|
|
169
169
|
NG: Nigeria
|
|
170
170
|
NI: Nicaragua
|
|
171
171
|
NL: Pays-Bas
|
|
@@ -216,7 +216,7 @@ SV: Salvador
|
|
|
216
216
|
SX: Saint-Martin (partie néerlandaise)
|
|
217
217
|
SY: Syrienne, République arabe
|
|
218
218
|
SZ: Eswatini
|
|
219
|
-
TC:
|
|
219
|
+
TC: Îles Turques-et-Caïques
|
|
220
220
|
TD: Tchad
|
|
221
221
|
TF: Terres australes françaises
|
|
222
222
|
TG: Togo
|
|
@@ -241,7 +241,7 @@ UZ: Ouzbékistan
|
|
|
241
241
|
VA: Saint-Siège (état de la cité du Vatican)
|
|
242
242
|
VC: Saint-Vincent-et-les-Grenadines
|
|
243
243
|
VE: Vénézuela
|
|
244
|
-
VG:
|
|
244
|
+
VG: îles Vierges britanniques
|
|
245
245
|
VI: Îles Vierges, États-Unis
|
|
246
246
|
VN: Viêt Nam
|
|
247
247
|
VU: Vanuatu
|
data/lib/countries/version.rb
CHANGED
data/lib/countries.rb
CHANGED
data/spec/country_spec.rb
CHANGED
|
@@ -48,9 +48,11 @@ describe ISO3166::Country do
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
it 'should return alternate names' do
|
|
51
|
-
expect(country.unofficial_names).to eq([
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
expect(country.unofficial_names).to eq(["United States", "USA",
|
|
52
|
+
"Vereinigte Staaten von Amerika",
|
|
53
|
+
"États-Unis", "Estados Unidos",
|
|
54
|
+
"アメリカ合衆国", "Verenigde Staten",
|
|
55
|
+
"Соединенные Штаты Америки"])
|
|
54
56
|
end
|
|
55
57
|
|
|
56
58
|
it 'should return translations' do
|
|
@@ -105,12 +107,20 @@ describe ISO3166::Country do
|
|
|
105
107
|
expect(country.world_region).to eq('AMER')
|
|
106
108
|
end
|
|
107
109
|
|
|
108
|
-
context 'with
|
|
110
|
+
context 'with Türkiye' do
|
|
109
111
|
let(:country) { ISO3166::Country.search('TR') }
|
|
110
112
|
|
|
111
113
|
it 'should indicate EMEA as the world region' do
|
|
112
114
|
expect(country.world_region).to eq('EMEA')
|
|
113
115
|
end
|
|
116
|
+
|
|
117
|
+
it 'has iso_short_name Türkiye' do
|
|
118
|
+
expect(country.iso_short_name).to eq('Türkiye')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it 'has iso_long_name Republic of Türkiye' do
|
|
122
|
+
expect(country.iso_long_name).to eq('The Republic of Türkiye')
|
|
123
|
+
end
|
|
114
124
|
end
|
|
115
125
|
|
|
116
126
|
context 'with Japan' do
|
|
@@ -814,15 +824,45 @@ describe ISO3166::Country do
|
|
|
814
824
|
end
|
|
815
825
|
end
|
|
816
826
|
|
|
817
|
-
context '
|
|
818
|
-
let(:
|
|
827
|
+
context 'sanity check for #771' do
|
|
828
|
+
let(:turkey) { ISO3166::Country.find_country_by_any_name('Turkey') }
|
|
819
829
|
|
|
820
830
|
it 'should be a country instance' do
|
|
831
|
+
expect(turkey).to be_a(ISO3166::Country)
|
|
832
|
+
expect(turkey.alpha2).to eq('TR')
|
|
833
|
+
end
|
|
834
|
+
end
|
|
835
|
+
|
|
836
|
+
context 'regression test for #746' do
|
|
837
|
+
let(:no_country) { ISO3166::Country.find_country_by_any_name(nil) }
|
|
838
|
+
|
|
839
|
+
it 'should not be a country instance' do
|
|
821
840
|
expect(no_country).to_not be_a(ISO3166::Country)
|
|
822
841
|
expect(no_country).to eq nil
|
|
823
842
|
end
|
|
824
843
|
end
|
|
825
844
|
|
|
845
|
+
context 'regression test for #388/#746/#776' do
|
|
846
|
+
before do
|
|
847
|
+
ISO3166.configure do |config|
|
|
848
|
+
config.locales = [:af, :am, :ar, :as, :az, :be, :bg, :bn, :br, :bs, :ca, :cs, :cy, :da, :de, :dz, :el, :en, :eo, :es, :et, :eu, :fa, :fi, :fo, :fr, :ga, :gl, :gu, :he, :hi, :hr, :hu, :hy, :ia, :id, :is, :it, :ja, :ka, :kk, :km, :kn, :ko, :ku, :lt, :lv, :mi, :mk, :ml, :mn, :mr, :ms, :mt, :nb, :ne, :nl, :nn, :oc, :or, :pa, :pl, :ps, :pt, :ro, :ru, :rw, :si, :sk, :sl, :so, :sq, :sr, :sv, :sw, :ta, :te, :th, :ti, :tk, :tl, :tr, :tt, :ug, :uk, :ve, :vi, :wa, :wo, :xh, :zh, :zu]
|
|
849
|
+
end
|
|
850
|
+
end
|
|
851
|
+
|
|
852
|
+
let(:no_country) { ISO3166::Country.find_country_by_translated_names(nil) }
|
|
853
|
+
let(:zimbabwe) { ISO3166::Country['ZW'] }
|
|
854
|
+
|
|
855
|
+
it 'should not be a country instance' do
|
|
856
|
+
expect(no_country).to_not be_a(ISO3166::Country)
|
|
857
|
+
expect(no_country).to eq nil
|
|
858
|
+
end
|
|
859
|
+
|
|
860
|
+
it 'translated_names should not include nil values' do
|
|
861
|
+
expect(zimbabwe.translation('no')).to be_nil
|
|
862
|
+
expect(zimbabwe.translated_names).not_to include(nil)
|
|
863
|
+
end
|
|
864
|
+
end
|
|
865
|
+
|
|
826
866
|
context 'when attempting to search by translations hash' do
|
|
827
867
|
let(:uk) { ISO3166::Country.find_country_by_translations({}) }
|
|
828
868
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: countries
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josh Robinson
|
|
@@ -11,22 +11,22 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2022-
|
|
14
|
+
date: 2022-10-28 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
|
-
name:
|
|
17
|
+
name: unaccent
|
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
|
19
19
|
requirements:
|
|
20
20
|
- - "~>"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '
|
|
22
|
+
version: '0.3'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - "~>"
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '
|
|
29
|
+
version: '0.3'
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: activesupport
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|