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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +1 -1
  3. data/CHANGELOG.md +22 -1
  4. data/README.markdown +1 -1
  5. data/countries.gemspec +1 -1
  6. data/lib/countries/cache/countries.json +1 -1
  7. data/lib/countries/cache/locales/ab.json +1 -1
  8. data/lib/countries/cache/locales/ak.json +1 -1
  9. data/lib/countries/cache/locales/an.json +1 -1
  10. data/lib/countries/cache/locales/ay.json +1 -1
  11. data/lib/countries/cache/locales/ba.json +1 -1
  12. data/lib/countries/cache/locales/bi.json +1 -1
  13. data/lib/countries/cache/locales/ch.json +1 -1
  14. data/lib/countries/cache/locales/de.json +1 -1
  15. data/lib/countries/cache/locales/ee.json +1 -1
  16. data/lib/countries/cache/locales/en.json +1 -1
  17. data/lib/countries/cache/locales/fr.json +1 -1
  18. data/lib/countries/cache/locales/gn.json +1 -1
  19. data/lib/countries/cache/locales/ki.json +1 -1
  20. data/lib/countries/cache/locales/kl.json +1 -1
  21. data/lib/countries/cache/locales/lt.json +1 -1
  22. data/lib/countries/cache/locales/sd.json +1 -1
  23. data/lib/countries/cache/locales/sw.json +1 -1
  24. data/lib/countries/cache/locales/tl.json +1 -1
  25. data/lib/countries/cache/locales/ve.json +1 -1
  26. data/lib/countries/cache/locales/xh.json +1 -1
  27. data/lib/countries/country/class_methods.rb +3 -3
  28. data/lib/countries/country.rb +1 -1
  29. data/lib/countries/data/countries/TR.yaml +2 -2
  30. data/lib/countries/data/countries/TW.yaml +14 -12
  31. data/lib/countries/data/translations/countries-ab.yaml +1 -1
  32. data/lib/countries/data/translations/countries-ak.yaml +1 -1
  33. data/lib/countries/data/translations/countries-an.yaml +1 -1
  34. data/lib/countries/data/translations/countries-ay.yaml +1 -1
  35. data/lib/countries/data/translations/countries-ba.yaml +1 -1
  36. data/lib/countries/data/translations/countries-bi.yaml +1 -1
  37. data/lib/countries/data/translations/countries-ch.yaml +1 -1
  38. data/lib/countries/data/translations/countries-de.yaml +2 -2
  39. data/lib/countries/data/translations/countries-ee.yaml +1 -1
  40. data/lib/countries/data/translations/countries-en.yaml +1 -1
  41. data/lib/countries/data/translations/countries-fr.yaml +7 -7
  42. data/lib/countries/data/translations/countries-gn.yaml +1 -1
  43. data/lib/countries/data/translations/countries-ki.yaml +1 -1
  44. data/lib/countries/data/translations/countries-kl.yaml +1 -1
  45. data/lib/countries/data/translations/countries-lt.yaml +1 -1
  46. data/lib/countries/data/translations/countries-sd.yaml +1 -1
  47. data/lib/countries/data/translations/countries-sw.yaml +1 -1
  48. data/lib/countries/data/translations/countries-tl.yaml +1 -1
  49. data/lib/countries/data/translations/countries-ve.yaml +1 -1
  50. data/lib/countries/data/translations/countries-xh.yaml +1 -1
  51. data/lib/countries/version.rb +1 -1
  52. data/lib/countries.rb +0 -2
  53. data/spec/country_spec.rb +46 -6
  54. 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: îles Cook
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: îles Féroé
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: îles Heard-et-MacDonald
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: îles Caïmans
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: île Norfolk
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: îles Turques-et-Caïques
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: Îles Vierges britanniques
244
+ VG: îles Vierges britanniques
245
245
  VI: Îles Vierges, États-Unis
246
246
  VN: Viêt Nam
247
247
  VU: Vanuatu
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad and Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad and Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad and Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -58,7 +58,7 @@ CV: Cabo Verde
58
58
  CW: Kiurasao
59
59
  CX: Kalėdų sala
60
60
  CY: Kipras
61
- CZ: Czechia
61
+ CZ: Čekija
62
62
  DE: Vokietija
63
63
  DJ: Džibutis
64
64
  DK: Danija
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: ترڪمانستان
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad and Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad and Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad at Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad and Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -227,7 +227,7 @@ TL: Timor-Leste
227
227
  TM: Turkmenistan
228
228
  TN: Tunisia
229
229
  TO: Tonga
230
- TR: Turkey
230
+ TR: Türkiye
231
231
  TT: Trinidad ne Tobago
232
232
  TV: Tuvalu
233
233
  TW: Taiwan
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Countries
4
- VERSION = '5.1.2'.freeze
4
+ VERSION = '5.2.0'.freeze
5
5
  end
data/lib/countries.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'sixarm_ruby_unaccent'
4
-
5
3
  require 'countries/version'
6
4
 
7
5
  require 'countries/iso3166'
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(['United States', 'USA', 'Murica',
52
- 'Vereinigte Staaten von Amerika', 'États-Unis',
53
- 'Estados Unidos', 'アメリカ合衆国', 'Verenigde Staten'])
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 Turkey' do
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 'regression test for #388' do
818
- let(:no_country) { ISO3166::Country.find_country_by_translated_names(nil) }
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.1.2
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-08-11 00:00:00.000000000 Z
14
+ date: 2022-10-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: sixarm_ruby_unaccent
17
+ name: unaccent
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '1.1'
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: '1.1'
29
+ version: '0.3'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: activesupport
32
32
  requirement: !ruby/object:Gem::Requirement