countries 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/lib/countries/cache/countries.json +1 -1
  3. data/lib/countries/data/countries/AD.yaml +5 -5
  4. data/lib/countries/data/countries/AE.yaml +11 -11
  5. data/lib/countries/data/countries/AF.yaml +7 -7
  6. data/lib/countries/data/countries/AG.yaml +9 -9
  7. data/lib/countries/data/countries/AI.yaml +9 -9
  8. data/lib/countries/data/countries/AL.yaml +3 -3
  9. data/lib/countries/data/countries/AM.yaml +5 -5
  10. data/lib/countries/data/countries/AO.yaml +11 -11
  11. data/lib/countries/data/countries/AQ.yaml +1 -1
  12. data/lib/countries/data/countries/AR.yaml +7 -7
  13. data/lib/countries/data/countries/AS.yaml +9 -9
  14. data/lib/countries/data/countries/AT.yaml +4 -4
  15. data/lib/countries/data/countries/AU.yaml +9 -9
  16. data/lib/countries/data/countries/AW.yaml +9 -9
  17. data/lib/countries/data/countries/AX.yaml +13 -13
  18. data/lib/countries/data/countries/AZ.yaml +7 -7
  19. data/lib/countries/data/countries/BA.yaml +3 -3
  20. data/lib/countries/data/countries/BB.yaml +9 -9
  21. data/lib/countries/data/countries/BD.yaml +7 -7
  22. data/lib/countries/data/countries/BE.yaml +5 -5
  23. data/lib/countries/data/countries/BF.yaml +7 -7
  24. data/lib/countries/data/countries/BG.yaml +5 -5
  25. data/lib/countries/data/countries/BH.yaml +10 -10
  26. data/lib/countries/data/countries/BI.yaml +3 -3
  27. data/lib/countries/data/countries/BJ.yaml +7 -7
  28. data/lib/countries/data/countries/BL.yaml +9 -9
  29. data/lib/countries/data/countries/BM.yaml +9 -9
  30. data/lib/countries/data/countries/BN.yaml +7 -7
  31. data/lib/countries/data/countries/BO.yaml +1 -1
  32. data/lib/countries/data/countries/BQ.yaml +9 -9
  33. data/lib/countries/data/countries/BR.yaml +7 -7
  34. data/lib/countries/data/countries/BS.yaml +9 -9
  35. data/lib/countries/data/countries/BT.yaml +3 -3
  36. data/lib/countries/data/countries/BV.yaml +7 -7
  37. data/lib/countries/data/countries/BW.yaml +5 -5
  38. data/lib/countries/data/countries/BY.yaml +6 -6
  39. data/lib/countries/data/countries/BZ.yaml +9 -9
  40. data/lib/countries/data/countries/CA.yaml +5 -5
  41. data/lib/countries/data/countries/CC.yaml +10 -10
  42. data/lib/countries/data/countries/CD.yaml +9 -2
  43. data/lib/countries/data/countries/CF.yaml +5 -5
  44. data/lib/countries/data/countries/CG.yaml +7 -7
  45. data/lib/countries/data/countries/CH.yaml +7 -7
  46. data/lib/countries/data/countries/CI.yaml +7 -7
  47. data/lib/countries/data/countries/CK.yaml +10 -10
  48. data/lib/countries/data/countries/CL.yaml +9 -9
  49. data/lib/countries/data/countries/CM.yaml +5 -5
  50. data/lib/countries/data/countries/CN.yaml +7 -7
  51. data/lib/countries/data/countries/CO.yaml +7 -7
  52. data/lib/countries/data/countries/CR.yaml +7 -7
  53. data/lib/countries/data/countries/CU.yaml +9 -9
  54. data/lib/countries/data/countries/CV.yaml +10 -10
  55. data/lib/countries/data/countries/CW.yaml +9 -9
  56. data/lib/countries/data/countries/CX.yaml +7 -7
  57. data/lib/countries/data/countries/CY.yaml +9 -9
  58. data/lib/countries/data/countries/CZ.yaml +3 -3
  59. data/lib/countries/data/countries/DE.yaml +5 -5
  60. data/lib/countries/data/countries/DJ.yaml +8 -8
  61. data/lib/countries/data/countries/DK.yaml +9 -9
  62. data/lib/countries/data/countries/DM.yaml +9 -9
  63. data/lib/countries/data/countries/DO.yaml +9 -9
  64. data/lib/countries/data/countries/DZ.yaml +4 -4
  65. data/lib/countries/data/countries/EC.yaml +10 -10
  66. data/lib/countries/data/countries/EE.yaml +9 -9
  67. data/lib/countries/data/countries/EG.yaml +8 -8
  68. data/lib/countries/data/countries/EH.yaml +8 -8
  69. data/lib/countries/data/countries/ER.yaml +7 -7
  70. data/lib/countries/data/countries/ES.yaml +9 -9
  71. data/lib/countries/data/countries/ET.yaml +9 -9
  72. data/lib/countries/data/countries/FI.yaml +7 -7
  73. data/lib/countries/data/countries/FJ.yaml +9 -9
  74. data/lib/countries/data/countries/FK.yaml +10 -10
  75. data/lib/countries/data/countries/FM.yaml +14 -7
  76. data/lib/countries/data/countries/FO.yaml +10 -10
  77. data/lib/countries/data/countries/FR.yaml +9 -9
  78. data/lib/countries/data/countries/GA.yaml +9 -9
  79. data/lib/countries/data/countries/GB.yaml +7 -7
  80. data/lib/countries/data/countries/GD.yaml +9 -9
  81. data/lib/countries/data/countries/GE.yaml +11 -11
  82. data/lib/countries/data/countries/GF.yaml +7 -7
  83. data/lib/countries/data/countries/GG.yaml +9 -9
  84. data/lib/countries/data/countries/GH.yaml +9 -9
  85. data/lib/countries/data/countries/GI.yaml +9 -9
  86. data/lib/countries/data/countries/GL.yaml +9 -9
  87. data/lib/countries/data/countries/GM.yaml +7 -7
  88. data/lib/countries/data/countries/GN.yaml +5 -5
  89. data/lib/countries/data/countries/GP.yaml +9 -9
  90. data/lib/countries/data/countries/GQ.yaml +8 -8
  91. data/lib/countries/data/countries/GR.yaml +7 -7
  92. data/lib/countries/data/countries/GS.yaml +9 -9
  93. data/lib/countries/data/countries/GT.yaml +9 -9
  94. data/lib/countries/data/countries/GU.yaml +9 -9
  95. data/lib/countries/data/countries/GW.yaml +7 -7
  96. data/lib/countries/data/countries/GY.yaml +7 -7
  97. data/lib/countries/data/countries/HK.yaml +7 -7
  98. data/lib/countries/data/countries/HM.yaml +12 -5
  99. data/lib/countries/data/countries/HN.yaml +9 -9
  100. data/lib/countries/data/countries/HR.yaml +7 -7
  101. data/lib/countries/data/countries/HT.yaml +7 -7
  102. data/lib/countries/data/countries/HU.yaml +5 -5
  103. data/lib/countries/data/countries/ID.yaml +9 -9
  104. data/lib/countries/data/countries/IE.yaml +9 -9
  105. data/lib/countries/data/countries/IL.yaml +7 -7
  106. data/lib/countries/data/countries/IM.yaml +8 -8
  107. data/lib/countries/data/countries/IN.yaml +7 -7
  108. data/lib/countries/data/countries/IO.yaml +11 -11
  109. data/lib/countries/data/countries/IQ.yaml +6 -6
  110. data/lib/countries/data/countries/IR.yaml +11 -11
  111. data/lib/countries/data/countries/IS.yaml +9 -9
  112. data/lib/countries/data/countries/IT.yaml +7 -7
  113. data/lib/countries/data/countries/JE.yaml +9 -9
  114. data/lib/countries/data/countries/JM.yaml +9 -9
  115. data/lib/countries/data/countries/JO.yaml +4 -4
  116. data/lib/countries/data/countries/JP.yaml +9 -9
  117. data/lib/countries/data/countries/KE.yaml +3 -3
  118. data/lib/countries/data/countries/KG.yaml +3 -3
  119. data/lib/countries/data/countries/KH.yaml +7 -7
  120. data/lib/countries/data/countries/KI.yaml +9 -9
  121. data/lib/countries/data/countries/KM.yaml +9 -9
  122. data/lib/countries/data/countries/KN.yaml +9 -9
  123. data/lib/countries/data/countries/KP.yaml +12 -5
  124. data/lib/countries/data/countries/KR.yaml +11 -11
  125. data/lib/countries/data/countries/KW.yaml +6 -6
  126. data/lib/countries/data/countries/KY.yaml +10 -10
  127. data/lib/countries/data/countries/KZ.yaml +7 -7
  128. data/lib/countries/data/countries/LA.yaml +7 -7
  129. data/lib/countries/data/countries/LB.yaml +4 -4
  130. data/lib/countries/data/countries/LC.yaml +9 -9
  131. data/lib/countries/data/countries/LI.yaml +3 -3
  132. data/lib/countries/data/countries/LK.yaml +9 -9
  133. data/lib/countries/data/countries/LR.yaml +7 -7
  134. data/lib/countries/data/countries/LS.yaml +3 -3
  135. data/lib/countries/data/countries/LT.yaml +6 -6
  136. data/lib/countries/data/countries/LU.yaml +3 -3
  137. data/lib/countries/data/countries/LV.yaml +3 -3
  138. data/lib/countries/data/countries/LY.yaml +6 -6
  139. data/lib/countries/data/countries/MA.yaml +8 -8
  140. data/lib/countries/data/countries/MC.yaml +5 -5
  141. data/lib/countries/data/countries/MD.yaml +11 -11
  142. data/lib/countries/data/countries/ME.yaml +5 -5
  143. data/lib/countries/data/countries/MF.yaml +9 -9
  144. data/lib/countries/data/countries/MG.yaml +9 -9
  145. data/lib/countries/data/countries/MH.yaml +11 -11
  146. data/lib/countries/data/countries/MK.yaml +10 -3
  147. data/lib/countries/data/countries/ML.yaml +7 -7
  148. data/lib/countries/data/countries/MM.yaml +7 -7
  149. data/lib/countries/data/countries/MN.yaml +7 -7
  150. data/lib/countries/data/countries/MO.yaml +7 -7
  151. data/lib/countries/data/countries/MP.yaml +9 -9
  152. data/lib/countries/data/countries/MQ.yaml +9 -9
  153. data/lib/countries/data/countries/MR.yaml +4 -4
  154. data/lib/countries/data/countries/MS.yaml +9 -9
  155. data/lib/countries/data/countries/MT.yaml +9 -9
  156. data/lib/countries/data/countries/MU.yaml +10 -10
  157. data/lib/countries/data/countries/MV.yaml +11 -11
  158. data/lib/countries/data/countries/MW.yaml +3 -3
  159. data/lib/countries/data/countries/MX.yaml +7 -7
  160. data/lib/countries/data/countries/MY.yaml +7 -7
  161. data/lib/countries/data/countries/MZ.yaml +9 -9
  162. data/lib/countries/data/countries/NA.yaml +5 -5
  163. data/lib/countries/data/countries/NC.yaml +9 -9
  164. data/lib/countries/data/countries/NE.yaml +5 -5
  165. data/lib/countries/data/countries/NF.yaml +10 -10
  166. data/lib/countries/data/countries/NG.yaml +5 -5
  167. data/lib/countries/data/countries/NI.yaml +9 -9
  168. data/lib/countries/data/countries/NL.yaml +9 -9
  169. data/lib/countries/data/countries/NO.yaml +9 -9
  170. data/lib/countries/data/countries/NP.yaml +1 -1
  171. data/lib/countries/data/countries/NR.yaml +9 -9
  172. data/lib/countries/data/countries/NU.yaml +9 -9
  173. data/lib/countries/data/countries/NZ.yaml +9 -9
  174. data/lib/countries/data/countries/OM.yaml +10 -10
  175. data/lib/countries/data/countries/PA.yaml +7 -7
  176. data/lib/countries/data/countries/PE.yaml +5 -5
  177. data/lib/countries/data/countries/PF.yaml +9 -9
  178. data/lib/countries/data/countries/PG.yaml +7 -7
  179. data/lib/countries/data/countries/PH.yaml +9 -9
  180. data/lib/countries/data/countries/PK.yaml +7 -7
  181. data/lib/countries/data/countries/PL.yaml +7 -7
  182. data/lib/countries/data/countries/PM.yaml +9 -9
  183. data/lib/countries/data/countries/PN.yaml +9 -9
  184. data/lib/countries/data/countries/PR.yaml +9 -9
  185. data/lib/countries/data/countries/PS.yaml +12 -12
  186. data/lib/countries/data/countries/PT.yaml +7 -7
  187. data/lib/countries/data/countries/PW.yaml +9 -9
  188. data/lib/countries/data/countries/PY.yaml +5 -5
  189. data/lib/countries/data/countries/QA.yaml +8 -8
  190. data/lib/countries/data/countries/RE.yaml +9 -9
  191. data/lib/countries/data/countries/RO.yaml +7 -7
  192. data/lib/countries/data/countries/RS.yaml +3 -3
  193. data/lib/countries/data/countries/RU.yaml +9 -9
  194. data/lib/countries/data/countries/RW.yaml +3 -3
  195. data/lib/countries/data/countries/SA.yaml +8 -8
  196. data/lib/countries/data/countries/SB.yaml +10 -10
  197. data/lib/countries/data/countries/SC.yaml +9 -9
  198. data/lib/countries/data/countries/SD.yaml +6 -6
  199. data/lib/countries/data/countries/SE.yaml +1 -1
  200. data/lib/countries/data/countries/SG.yaml +9 -9
  201. data/lib/countries/data/countries/SH.yaml +11 -11
  202. data/lib/countries/data/countries/SI.yaml +7 -7
  203. data/lib/countries/data/countries/SJ.yaml +10 -10
  204. data/lib/countries/data/countries/SK.yaml +3 -3
  205. data/lib/countries/data/countries/SL.yaml +9 -9
  206. data/lib/countries/data/countries/SM.yaml +3 -3
  207. data/lib/countries/data/countries/SN.yaml +5 -5
  208. data/lib/countries/data/countries/SO.yaml +8 -8
  209. data/lib/countries/data/countries/SR.yaml +9 -9
  210. data/lib/countries/data/countries/SS.yaml +7 -7
  211. data/lib/countries/data/countries/ST.yaml +9 -9
  212. data/lib/countries/data/countries/SV.yaml +9 -9
  213. data/lib/countries/data/countries/SX.yaml +7 -7
  214. data/lib/countries/data/countries/SY.yaml +5 -5
  215. data/lib/countries/data/countries/SZ.yaml +5 -5
  216. data/lib/countries/data/countries/TC.yaml +10 -10
  217. data/lib/countries/data/countries/TD.yaml +8 -8
  218. data/lib/countries/data/countries/TF.yaml +9 -9
  219. data/lib/countries/data/countries/TG.yaml +5 -5
  220. data/lib/countries/data/countries/TH.yaml +9 -9
  221. data/lib/countries/data/countries/TJ.yaml +7 -7
  222. data/lib/countries/data/countries/TK.yaml +10 -10
  223. data/lib/countries/data/countries/TL.yaml +9 -9
  224. data/lib/countries/data/countries/TM.yaml +9 -9
  225. data/lib/countries/data/countries/TN.yaml +6 -6
  226. data/lib/countries/data/countries/TO.yaml +9 -9
  227. data/lib/countries/data/countries/TR.yaml +5 -5
  228. data/lib/countries/data/countries/TT.yaml +9 -9
  229. data/lib/countries/data/countries/TV.yaml +10 -10
  230. data/lib/countries/data/countries/TW.yaml +9 -9
  231. data/lib/countries/data/countries/TZ.yaml +11 -4
  232. data/lib/countries/data/countries/UA.yaml +8 -8
  233. data/lib/countries/data/countries/UG.yaml +7 -7
  234. data/lib/countries/data/countries/UM.yaml +3 -3
  235. data/lib/countries/data/countries/US.yaml +10 -10
  236. data/lib/countries/data/countries/UY.yaml +7 -7
  237. data/lib/countries/data/countries/UZ.yaml +5 -5
  238. data/lib/countries/data/countries/VA.yaml +14 -7
  239. data/lib/countries/data/countries/VC.yaml +10 -10
  240. data/lib/countries/data/countries/VE.yaml +11 -11
  241. data/lib/countries/data/countries/VG.yaml +13 -6
  242. data/lib/countries/data/countries/VI.yaml +10 -10
  243. data/lib/countries/data/countries/VN.yaml +5 -5
  244. data/lib/countries/data/countries/VU.yaml +9 -9
  245. data/lib/countries/data/countries/WF.yaml +9 -9
  246. data/lib/countries/data/countries/WS.yaml +9 -9
  247. data/lib/countries/data/countries/YE.yaml +10 -10
  248. data/lib/countries/data/countries/YT.yaml +9 -9
  249. data/lib/countries/data/countries/ZA.yaml +7 -7
  250. data/lib/countries/data/countries/ZM.yaml +5 -5
  251. data/lib/countries/data/countries/ZW.yaml +3 -3
  252. data/lib/countries/tasks/geocoding.rake +10 -1
  253. data/lib/countries/version.rb +1 -1
  254. data/spec/country_spec.rb +1 -1
  255. metadata +2 -2
@@ -27,7 +27,7 @@ ZW:
27
27
  - Zimbabwe
28
28
  - Simbabwe
29
29
  - Zimbabue
30
- - "ジンバブエ"
30
+ - ジンバブエ
31
31
  languages_official:
32
32
  - en
33
33
  - sn
@@ -41,13 +41,13 @@ ZW:
41
41
  latitude_dec: "-19.000280380249023"
42
42
  longitude: 29.154857
43
43
  longitude_dec: '29.86876106262207'
44
- max_latitude: -15.6107883
44
+ max_latitude: -15.609319
45
45
  max_longitude: 33.068236
46
46
  min_latitude: -22.4223538
47
47
  min_longitude: 25.237368
48
48
  bounds:
49
49
  northeast:
50
- lat: -15.6107883
50
+ lat: -15.609319
51
51
  lng: 33.068236
52
52
  southwest:
53
53
  lat: -22.4223538
@@ -1,5 +1,10 @@
1
1
  require 'geocoder'
2
2
  require 'retryable'
3
+
4
+ Geocoder.configure(
5
+ timeout: 10
6
+ )
7
+
3
8
  # raise on geocoding errors such as query limit exceeded
4
9
  Geocoder.configure(always_raise: :all)
5
10
  # Try to geocode a given query, on exceptions it retries up to 3 times then gives up.
@@ -36,8 +41,12 @@ namespace :geocode do
36
41
  # Load unmutated yaml file.
37
42
  data = load_country_yaml(country.alpha2)
38
43
 
39
- next unless (result = geocode(country.name))
44
+ lookup = "#{country.alpha2} country"
45
+ # LU country lookup appears to match to Los Angeles
46
+ lookup = country.name if country.alpha2 == 'LU'
40
47
 
48
+ next unless (result = geocode(lookup))
49
+ puts 'WARNING:: Geocoder returned something that was not a country' unless result.types.include?('country')
41
50
  geometry = result.geometry
42
51
 
43
52
  # Extract center point data
@@ -1,3 +1,3 @@
1
1
  module Countries
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
data/spec/country_spec.rb CHANGED
@@ -49,7 +49,7 @@ describe ISO3166::Country do
49
49
  end
50
50
 
51
51
  it 'should return bounds' do
52
- expect(country.bounds['northeast']['lat']).to eq(71.3867745)
52
+ expect(country.bounds['northeast']['lat']).to eq(71.5388001)
53
53
  end
54
54
 
55
55
  it 'should return the decimal Latitude' 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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Robinson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-11-14 00:00:00.000000000 Z
13
+ date: 2016-11-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n_data