countries 4.0.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +3 -3
  3. data/CHANGELOG.md +19 -0
  4. data/README.markdown +6 -0
  5. data/countries.gemspec +1 -1
  6. data/lib/countries/cache/countries.json +1 -1
  7. data/lib/countries/cache/locales/mk.json +1 -1
  8. data/lib/countries/cache/locales/sr.json +1 -1
  9. data/lib/countries/country/class_methods.rb +8 -1
  10. data/lib/countries/data/countries/NL.yaml +1 -1
  11. data/lib/countries/data/subdivisions/AE.yaml +33 -21
  12. data/lib/countries/data/subdivisions/AF.yaml +162 -128
  13. data/lib/countries/data/subdivisions/AG.yaml +44 -35
  14. data/lib/countries/data/subdivisions/AL.yaml +252 -240
  15. data/lib/countries/data/subdivisions/AM.yaml +57 -45
  16. data/lib/countries/data/subdivisions/AO.yaml +72 -54
  17. data/lib/countries/data/subdivisions/AR.yaml +98 -72
  18. data/lib/countries/data/subdivisions/AS.yaml +40 -40
  19. data/lib/countries/data/subdivisions/AT.yaml +38 -27
  20. data/lib/countries/data/subdivisions/AU.yaml +33 -24
  21. data/lib/countries/data/subdivisions/AW.yaml +6 -6
  22. data/lib/countries/data/subdivisions/AX.yaml +27 -27
  23. data/lib/countries/data/subdivisions/AZ.yaml +367 -290
  24. data/lib/countries/data/subdivisions/BA.yaml +130 -127
  25. data/lib/countries/data/subdivisions/BB.yaml +47 -33
  26. data/lib/countries/data/subdivisions/BD.yaml +350 -338
  27. data/lib/countries/data/subdivisions/BE.yaml +69 -55
  28. data/lib/countries/data/subdivisions/BF.yaml +340 -282
  29. data/lib/countries/data/subdivisions/BG.yaml +112 -84
  30. data/lib/countries/data/subdivisions/BH.yaml +23 -19
  31. data/lib/countries/data/subdivisions/BI.yaml +98 -81
  32. data/lib/countries/data/subdivisions/BJ.yaml +60 -36
  33. data/lib/countries/data/subdivisions/BL.yaml +5 -5
  34. data/lib/countries/data/subdivisions/BN.yaml +20 -16
  35. data/lib/countries/data/subdivisions/BO.yaml +36 -27
  36. data/lib/countries/data/subdivisions/BQ.yaml +13 -9
  37. data/lib/countries/data/subdivisions/BR.yaml +138 -85
  38. data/lib/countries/data/subdivisions/BS.yaml +340 -309
  39. data/lib/countries/data/subdivisions/BT.yaml +80 -60
  40. data/lib/countries/data/subdivisions/BW.yaml +122 -104
  41. data/lib/countries/data/subdivisions/BY.yaml +58 -50
  42. data/lib/countries/data/subdivisions/BZ.yaml +24 -18
  43. data/lib/countries/data/subdivisions/CA.yaml +54 -39
  44. data/lib/countries/data/subdivisions/CD.yaml +269 -242
  45. data/lib/countries/data/subdivisions/CF.yaml +70 -51
  46. data/lib/countries/data/subdivisions/CG.yaml +57 -44
  47. data/lib/countries/data/subdivisions/CH.yaml +104 -78
  48. data/lib/countries/data/subdivisions/CI.yaml +247 -235
  49. data/lib/countries/data/subdivisions/CL.yaml +64 -48
  50. data/lib/countries/data/subdivisions/CM.yaml +44 -30
  51. data/lib/countries/data/subdivisions/CN.yaml +691 -12
  52. data/lib/countries/data/subdivisions/CO.yaml +169 -103
  53. data/lib/countries/data/subdivisions/CR.yaml +28 -21
  54. data/lib/countries/data/subdivisions/CU.yaml +63 -48
  55. data/lib/countries/data/subdivisions/CV.yaml +173 -150
  56. data/lib/countries/data/subdivisions/CW.yaml +6 -6
  57. data/lib/countries/data/subdivisions/CY.yaml +24 -18
  58. data/lib/countries/data/subdivisions/CZ.yaml +1633 -1602
  59. data/lib/countries/data/subdivisions/DE.yaml +82 -48
  60. data/lib/countries/data/subdivisions/DJ.yaml +26 -18
  61. data/lib/countries/data/subdivisions/DK.yaml +76 -71
  62. data/lib/countries/data/subdivisions/DM.yaml +40 -30
  63. data/lib/countries/data/subdivisions/DO.yaml +244 -214
  64. data/lib/countries/data/subdivisions/DZ.yaml +196 -148
  65. data/lib/countries/data/subdivisions/EC.yaml +100 -76
  66. data/lib/countries/data/subdivisions/EE.yaml +330 -45
  67. data/lib/countries/data/subdivisions/EG.yaml +108 -81
  68. data/lib/countries/data/subdivisions/ER.yaml +24 -18
  69. data/lib/countries/data/subdivisions/ES.yaml +415 -344
  70. data/lib/countries/data/subdivisions/ET.yaml +47 -33
  71. data/lib/countries/data/subdivisions/FI.yaml +268 -249
  72. data/lib/countries/data/subdivisions/FJ.yaml +189 -169
  73. data/lib/countries/data/subdivisions/FM.yaml +19 -16
  74. data/lib/countries/data/subdivisions/FR.yaml +976 -845
  75. data/lib/countries/data/subdivisions/GA.yaml +36 -27
  76. data/lib/countries/data/subdivisions/GB.yaml +1244 -1024
  77. data/lib/countries/data/subdivisions/GD.yaml +28 -21
  78. data/lib/countries/data/subdivisions/GE.yaml +50 -36
  79. data/lib/countries/data/subdivisions/GF.yaml +5 -5
  80. data/lib/countries/data/subdivisions/GH.yaml +87 -66
  81. data/lib/countries/data/subdivisions/GL.yaml +62 -56
  82. data/lib/countries/data/subdivisions/GM.yaml +26 -18
  83. data/lib/countries/data/subdivisions/GN.yaml +226 -183
  84. data/lib/countries/data/subdivisions/GP.yaml +5 -5
  85. data/lib/countries/data/subdivisions/GQ.yaml +42 -31
  86. data/lib/countries/data/subdivisions/GR.yaml +329 -316
  87. data/lib/countries/data/subdivisions/GT.yaml +92 -70
  88. data/lib/countries/data/subdivisions/GU.yaml +139 -139
  89. data/lib/countries/data/subdivisions/GW.yaml +74 -64
  90. data/lib/countries/data/subdivisions/GY.yaml +40 -30
  91. data/lib/countries/data/subdivisions/HK.yaml +131 -131
  92. data/lib/countries/data/subdivisions/HN.yaml +71 -54
  93. data/lib/countries/data/subdivisions/HR.yaml +85 -63
  94. data/lib/countries/data/subdivisions/HT.yaml +48 -38
  95. data/lib/countries/data/subdivisions/HU.yaml +170 -129
  96. data/lib/countries/data/subdivisions/ID.yaml +296 -213
  97. data/lib/countries/data/subdivisions/IE.yaml +164 -134
  98. data/lib/countries/data/subdivisions/IL.yaml +24 -18
  99. data/lib/countries/data/subdivisions/IN.yaml +207 -135
  100. data/lib/countries/data/subdivisions/IQ.yaml +83 -65
  101. data/lib/countries/data/subdivisions/IR.yaml +143 -109
  102. data/lib/countries/data/subdivisions/IS.yaml +255 -31
  103. data/lib/countries/data/subdivisions/IT.yaml +712 -576
  104. data/lib/countries/data/subdivisions/JM.yaml +56 -42
  105. data/lib/countries/data/subdivisions/JO.yaml +84 -72
  106. data/lib/countries/data/subdivisions/JP.yaml +194 -145
  107. data/lib/countries/data/subdivisions/KE.yaml +603 -557
  108. data/lib/countries/data/subdivisions/KG.yaml +45 -35
  109. data/lib/countries/data/subdivisions/KH.yaml +130 -105
  110. data/lib/countries/data/subdivisions/KI.yaml +16 -13
  111. data/lib/countries/data/subdivisions/KM.yaml +12 -9
  112. data/lib/countries/data/subdivisions/KN.yaml +80 -64
  113. data/lib/countries/data/subdivisions/KP.yaml +201 -187
  114. data/lib/countries/data/subdivisions/KR.yaml +106 -83
  115. data/lib/countries/data/subdivisions/KW.yaml +23 -18
  116. data/lib/countries/data/subdivisions/KZ.yaml +74 -56
  117. data/lib/countries/data/subdivisions/LA.yaml +87 -71
  118. data/lib/countries/data/subdivisions/LB.yaml +65 -60
  119. data/lib/countries/data/subdivisions/LC.yaml +119 -110
  120. data/lib/countries/data/subdivisions/LI.yaml +85 -73
  121. data/lib/countries/data/subdivisions/LK.yaml +195 -174
  122. data/lib/countries/data/subdivisions/LR.yaml +82 -67
  123. data/lib/countries/data/subdivisions/LS.yaml +40 -30
  124. data/lib/countries/data/subdivisions/LT.yaml +771 -750
  125. data/lib/countries/data/subdivisions/LU.yaml +157 -145
  126. data/lib/countries/data/subdivisions/LV.yaml +1670 -1549
  127. data/lib/countries/data/subdivisions/LY.yaml +98 -78
  128. data/lib/countries/data/subdivisions/MA.yaml +554 -520
  129. data/lib/countries/data/subdivisions/MC.yaml +189 -187
  130. data/lib/countries/data/subdivisions/MD.yaml +395 -356
  131. data/lib/countries/data/subdivisions/ME.yaml +108 -90
  132. data/lib/countries/data/subdivisions/MF.yaml +6 -6
  133. data/lib/countries/data/subdivisions/MG.yaml +24 -18
  134. data/lib/countries/data/subdivisions/MH.yaml +128 -121
  135. data/lib/countries/data/subdivisions/MK.yaml +1757 -1698
  136. data/lib/countries/data/subdivisions/ML.yaml +49 -38
  137. data/lib/countries/data/subdivisions/MM.yaml +80 -53
  138. data/lib/countries/data/subdivisions/MN.yaml +89 -66
  139. data/lib/countries/data/subdivisions/MO.yaml +6 -6
  140. data/lib/countries/data/subdivisions/MP.yaml +33 -33
  141. data/lib/countries/data/subdivisions/MQ.yaml +5 -5
  142. data/lib/countries/data/subdivisions/MR.yaml +84 -72
  143. data/lib/countries/data/subdivisions/MT.yaml +280 -212
  144. data/lib/countries/data/subdivisions/MU.yaml +74 -55
  145. data/lib/countries/data/subdivisions/MV.yaml +171 -151
  146. data/lib/countries/data/subdivisions/MW.yaml +156 -125
  147. data/lib/countries/data/subdivisions/MX.yaml +139 -105
  148. data/lib/countries/data/subdivisions/MY.yaml +66 -48
  149. data/lib/countries/data/subdivisions/MZ.yaml +46 -33
  150. data/lib/countries/data/subdivisions/NA.yaml +54 -42
  151. data/lib/countries/data/subdivisions/NC.yaml +26 -26
  152. data/lib/countries/data/subdivisions/NE.yaml +41 -24
  153. data/lib/countries/data/subdivisions/NG.yaml +185 -111
  154. data/lib/countries/data/subdivisions/NI.yaml +68 -51
  155. data/lib/countries/data/subdivisions/NL.yaml +118 -102
  156. data/lib/countries/data/subdivisions/NO.yaml +1282 -0
  157. data/lib/countries/data/subdivisions/NP.yaml +157 -145
  158. data/lib/countries/data/subdivisions/NR.yaml +56 -42
  159. data/lib/countries/data/subdivisions/NZ.yaml +100 -84
  160. data/lib/countries/data/subdivisions/OM.yaml +104 -93
  161. data/lib/countries/data/subdivisions/PA.yaml +74 -61
  162. data/lib/countries/data/subdivisions/PE.yaml +108 -82
  163. data/lib/countries/data/subdivisions/PF.yaml +40 -40
  164. data/lib/countries/data/subdivisions/PG.yaml +113 -93
  165. data/lib/countries/data/subdivisions/PH.yaml +525 -432
  166. data/lib/countries/data/subdivisions/PK.yaml +55 -46
  167. data/lib/countries/data/subdivisions/PL.yaml +161 -130
  168. data/lib/countries/data/subdivisions/PM.yaml +19 -19
  169. data/lib/countries/data/subdivisions/PR.yaml +551 -551
  170. data/lib/countries/data/subdivisions/PS.yaml +184 -176
  171. data/lib/countries/data/subdivisions/PT.yaml +81 -60
  172. data/lib/countries/data/subdivisions/PW.yaml +72 -52
  173. data/lib/countries/data/subdivisions/PY.yaml +72 -54
  174. data/lib/countries/data/subdivisions/QA.yaml +62 -53
  175. data/lib/countries/data/subdivisions/RE.yaml +5 -5
  176. data/lib/countries/data/subdivisions/RO.yaml +169 -126
  177. data/lib/countries/data/subdivisions/RS.yaml +158 -130
  178. data/lib/countries/data/subdivisions/RU.yaml +357 -270
  179. data/lib/countries/data/subdivisions/RW.yaml +22 -15
  180. data/lib/countries/data/subdivisions/SA.yaml +52 -39
  181. data/lib/countries/data/subdivisions/SB.yaml +40 -30
  182. data/lib/countries/data/subdivisions/SC.yaml +120 -91
  183. data/lib/countries/data/subdivisions/SD.yaml +98 -81
  184. data/lib/countries/data/subdivisions/SE.yaml +84 -63
  185. data/lib/countries/data/subdivisions/SG.yaml +74 -74
  186. data/lib/countries/data/subdivisions/SH.yaml +23 -20
  187. data/lib/countries/data/subdivisions/SI.yaml +987 -811
  188. data/lib/countries/data/subdivisions/SK.yaml +32 -24
  189. data/lib/countries/data/subdivisions/SL.yaml +21 -17
  190. data/lib/countries/data/subdivisions/SM.yaml +37 -27
  191. data/lib/countries/data/subdivisions/SN.yaml +80 -66
  192. data/lib/countries/data/subdivisions/SO.yaml +69 -54
  193. data/lib/countries/data/subdivisions/SR.yaml +40 -30
  194. data/lib/countries/data/subdivisions/SS.yaml +120 -110
  195. data/lib/countries/data/subdivisions/ST.yaml +27 -6
  196. data/lib/countries/data/subdivisions/SV.yaml +54 -42
  197. data/lib/countries/data/subdivisions/SX.yaml +6 -6
  198. data/lib/countries/data/subdivisions/SY.yaml +67 -54
  199. data/lib/countries/data/subdivisions/SZ.yaml +16 -12
  200. data/lib/countries/data/subdivisions/TD.yaml +143 -120
  201. data/lib/countries/data/subdivisions/TF.yaml +27 -27
  202. data/lib/countries/data/subdivisions/TG.yaml +20 -15
  203. data/lib/countries/data/subdivisions/TH.yaml +322 -242
  204. data/lib/countries/data/subdivisions/TJ.yaml +37 -31
  205. data/lib/countries/data/subdivisions/TL.yaml +52 -39
  206. data/lib/countries/data/subdivisions/TM.yaml +31 -26
  207. data/lib/countries/data/subdivisions/TN.yaml +96 -72
  208. data/lib/countries/data/subdivisions/TO.yaml +19 -15
  209. data/lib/countries/data/subdivisions/TR.yaml +324 -243
  210. data/lib/countries/data/subdivisions/TT.yaml +88 -70
  211. data/lib/countries/data/subdivisions/TV.yaml +55 -47
  212. data/lib/countries/data/subdivisions/TW.yaml +146 -123
  213. data/lib/countries/data/subdivisions/TZ.yaml +182 -127
  214. data/lib/countries/data/subdivisions/UA.yaml +109 -81
  215. data/lib/countries/data/subdivisions/UG.yaml +912 -775
  216. data/lib/countries/data/subdivisions/UM.yaml +45 -36
  217. data/lib/countries/data/subdivisions/US.yaml +323 -204
  218. data/lib/countries/data/subdivisions/UY.yaml +78 -57
  219. data/lib/countries/data/subdivisions/UZ.yaml +57 -42
  220. data/lib/countries/data/subdivisions/VC.yaml +32 -22
  221. data/lib/countries/data/subdivisions/VE.yaml +100 -75
  222. data/lib/countries/data/subdivisions/VI.yaml +26 -26
  223. data/lib/countries/data/subdivisions/VN.yaml +256 -191
  224. data/lib/countries/data/subdivisions/VU.yaml +24 -18
  225. data/lib/countries/data/subdivisions/WF.yaml +41 -38
  226. data/lib/countries/data/subdivisions/WS.yaml +44 -33
  227. data/lib/countries/data/subdivisions/YE.yaml +114 -94
  228. data/lib/countries/data/subdivisions/YT.yaml +125 -125
  229. data/lib/countries/data/subdivisions/ZA.yaml +56 -39
  230. data/lib/countries/data/subdivisions/ZM.yaml +48 -38
  231. data/lib/countries/data/subdivisions/ZW.yaml +39 -30
  232. data/lib/countries/data/translation_corrections.yaml +2 -0
  233. data/lib/countries/version.rb +1 -1
  234. data/spec/country_spec.rb +24 -0
  235. data/spec/data_spec.rb +4 -4
  236. metadata +5 -5
@@ -1,7 +1,7 @@
1
1
  ---
2
- BU:
2
+ BU:
3
3
  name: Bulawayo
4
- code:
4
+ code:
5
5
  unofficial_names: Bulawayo
6
6
  geo:
7
7
  latitude: -20.1325066
@@ -17,10 +17,10 @@ BU:
17
17
  ar: إقليم بولاوايو
18
18
  ccp: "\U0001111D\U0001112A\U00011123\U00011124\U00011103\U0001112E"
19
19
  be: Булавая
20
- comments:
21
- HA:
20
+ comments:
21
+ HA:
22
22
  name: Harare
23
- code:
23
+ code:
24
24
  unofficial_names: Harare
25
25
  geo:
26
26
  latitude: -17.863889
@@ -41,10 +41,11 @@ HA:
41
41
  pt: Harare
42
42
  nb: Harare Province
43
43
  ne: हरारे प्रदेश
44
- comments:
45
- MA:
44
+ 'no': Harare Province
45
+ comments:
46
+ MA:
46
47
  name: Manicaland
47
- code:
48
+ code:
48
49
  unofficial_names: Manicaland
49
50
  geo:
50
51
  latitude: -18.9216386
@@ -102,10 +103,11 @@ MA:
102
103
  ceb: Manicaland Province
103
104
  sr_Latn: Manikalend
104
105
  ccp: "\U0001111F\U00011127\U0001111A\U00011128\U00011107\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134"
105
- comments:
106
- MC:
106
+ 'no': Manicaland
107
+ comments:
108
+ MC:
107
109
  name: Mashonaland Central
108
- code:
110
+ code:
109
111
  unofficial_names: Mashonaland Central
110
112
  geo:
111
113
  latitude: -16.7644295
@@ -163,10 +165,11 @@ MC:
163
165
  sr_Latn: Mašonalend Central
164
166
  ccp: "\U0001111F\U00011125\U0001112E\U0001111A\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134
165
167
  \U00011125\U0001112C\U0001111A\U00011134\U00011111\U00011133\U00011122\U00011123\U00011134"
166
- comments:
167
- ME:
168
+ 'no': Mashonaland Central
169
+ comments:
170
+ ME:
168
171
  name: Mashonaland East
169
- code:
172
+ code:
170
173
  unofficial_names: Mashonaland East
171
174
  geo:
172
175
  latitude: -18.5871642
@@ -225,10 +228,11 @@ ME:
225
228
  ccp: "\U0001111F\U00011125\U0001112E\U0001111A\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134
226
229
  \U0001111B\U0001112A\U00011107\U00011134"
227
230
  he: משונאלנד מזרח פרובינציה
228
- comments:
229
- MI:
231
+ 'no': Mashonaland East
232
+ comments:
233
+ MI:
230
234
  name: Midlands
231
- code:
235
+ code:
232
236
  unofficial_names: Midlands
233
237
  geo:
234
238
  latitude: -19.0552009
@@ -285,10 +289,11 @@ MI:
285
289
  ceb: Midlands Province
286
290
  sr_Latn: Midlends
287
291
  ccp: "\U0001111F\U00011128\U00011116\U00011134\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134\U00011125\U00011134"
288
- comments:
289
- MN:
292
+ 'no': Midlands
293
+ comments:
294
+ MN:
290
295
  name: Matabeleland North
291
- code:
296
+ code:
292
297
  unofficial_names: Matabeleland North
293
298
  geo:
294
299
  latitude: -18.5331566
@@ -347,10 +352,11 @@ MN:
347
352
  sr_Latn: Matabelelend Sever
348
353
  ccp: "\U0001111F\U00011111\U0001111D\U00011128\U00011123\U00011128\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134
349
354
  \U00011105\U0001112A\U00011116\U00011133\U00011126\U00011127\U00011122\U00011134"
350
- comments:
351
- MS:
355
+ 'no': Matabeleland North
356
+ comments:
357
+ MS:
352
358
  name: Matabeleland South
353
- code:
359
+ code:
354
360
  unofficial_names: Matabeleland South
355
361
  geo:
356
362
  latitude: -21.052337
@@ -408,10 +414,11 @@ MS:
408
414
  sr_Latn: Matabelelend Jug
409
415
  ccp: "\U0001111F\U00011111\U0001111D\U00011128\U00011123\U00011128\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134
410
416
  \U00011118\U00011127\U0001110A\U00011128\U0001111A\U00011134"
411
- comments:
412
- MV:
417
+ 'no': Matabeleland South
418
+ comments:
419
+ MV:
413
420
  name: Masvingo
414
- code:
421
+ code:
415
422
  unofficial_names: Masvingo
416
423
  geo:
417
424
  latitude: -20.074444
@@ -468,10 +475,11 @@ MV:
468
475
  ceb: Masvingo Province
469
476
  sr_Latn: Mašvingo
470
477
  ccp: "\U0001111F\U0001110C\U00011134\U0001111E\U00011128\U00011101\U00011109\U0001112E"
471
- comments:
472
- MW:
478
+ 'no': Masvingo
479
+ comments:
480
+ MW:
473
481
  name: Mashonaland West
474
- code:
482
+ code:
475
483
  unofficial_names: Mashonaland West
476
484
  geo:
477
485
  latitude: -17.4851029
@@ -529,4 +537,5 @@ MW:
529
537
  sr_Latn: Mašonalend Zapad
530
538
  ccp: "\U0001111F\U00011125\U0001112E\U0001111A\U00011123\U00011133\U00011120\U0001111A\U00011133\U00011113\U00011134
531
539
  \U0001111B\U00011127\U0001110F\U00011128\U0001111F\U00011134"
532
- comments:
540
+ 'no': Mashonaland West
541
+ comments:
@@ -32,6 +32,8 @@ fa:
32
32
  he:
33
33
  PS: "פלסטין, מדינת"
34
34
  VI: "איי הבתולה (ארה)"
35
+ mk:
36
+ MK: "Северна Македонија"
35
37
  sv:
36
38
  GB: "Storbritannien"
37
39
  RU: "Ryssland"
@@ -1,3 +1,3 @@
1
1
  module Countries
2
- VERSION = '4.0.1'.freeze
2
+ VERSION = '4.1.0'.freeze
3
3
  end
data/spec/country_spec.rb CHANGED
@@ -248,6 +248,10 @@ describe ISO3166::Country do
248
248
  expect(virginia.name).to eq('Virginia')
249
249
  end
250
250
 
251
+ it 'should have a code' do
252
+ expect(virginia.code).to eq('VA')
253
+ end
254
+
251
255
  it 'should behave like a hash' do
252
256
  expect(virginia['name']).to eq('Virginia')
253
257
  end
@@ -968,4 +972,24 @@ describe ISO3166::Country do
968
972
  expect(countries.all? { |country| country.un_locode.length == 2 }).to be
969
973
  end
970
974
  end
975
+
976
+ describe '.pluck' do
977
+ let(:args) { [] }
978
+
979
+ subject { ISO3166::Country.pluck(*args) }
980
+
981
+ it "returns empty arrays" do
982
+ expect(subject.first).to be_empty
983
+ expect(subject.last).to be_empty
984
+ end
985
+
986
+ context "when asking for alpha2, alpha3 and name" do
987
+ let(:args) { [:alpha2, :alpha3, :name] }
988
+
989
+ it "returns the correct values" do
990
+ expect(subject.first).to eq(["AD", "AND", "Andorra"])
991
+ expect(subject.last).to eq(["ZW", "ZWE", "Zimbabwe"])
992
+ end
993
+ end
994
+ end
971
995
  end
data/spec/data_spec.rb CHANGED
@@ -116,8 +116,8 @@ describe ISO3166::Data do
116
116
  expect(subject.name).to eq 'NEW Taiwan'
117
117
  expect(subject.translations).to eq('en' => 'NEW Taiwan',
118
118
  'de' => 'NEW Taiwan')
119
- expect(subject.subdivisions).to eq('CHA' => ISO3166::Subdivision.new({name: 'New Changhua'}),
120
- 'CYI' => ISO3166::Subdivision.new({name: 'New Municipality'}))
119
+ expect(subject.subdivisions).to eq('CHA' => ISO3166::Subdivision.new({name: 'New Changhua', code: 'CHA'}),
120
+ 'CYI' => ISO3166::Subdivision.new({name: 'New Municipality', code: 'CYI'}))
121
121
  end
122
122
  end
123
123
 
@@ -143,8 +143,8 @@ describe ISO3166::Data do
143
143
  data = ISO3166::Data.new('LOL').call
144
144
  expect(data['name']).to eq 'Happy Country'
145
145
  expect(subject.name).to eq 'Happy Country'
146
- expect(subject.subdivisions).to eq('LOL1' => ISO3166::Subdivision.new({name: 'Happy sub1'}),
147
- 'LOL2' => ISO3166::Subdivision.new({name: 'Happy sub2'}))
146
+ expect(subject.subdivisions).to eq('LOL1' => ISO3166::Subdivision.new({name: 'Happy sub1', code: 'LOL1'}),
147
+ 'LOL2' => ISO3166::Subdivision.new({name: 'Happy sub2', code: 'LOL2'}))
148
148
  end
149
149
 
150
150
  it 'detect a stale cache' do
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: 4.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Robinson
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-07-19 00:00:00.000000000 Z
14
+ date: 2021-11-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n_data
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.13.0
22
+ version: 0.13.1
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: 0.13.0
29
+ version: 0.13.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: sixarm_ruby_unaccent
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -783,7 +783,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
783
783
  - !ruby/object:Gem::Version
784
784
  version: '0'
785
785
  requirements: []
786
- rubygems_version: 3.2.22
786
+ rubygems_version: 3.2.32
787
787
  signing_key:
788
788
  specification_version: 4
789
789
  summary: Gives you a country object full of all sorts of useful information.