countries 2.0.6 β†’ 2.1.1

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 (273) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +49 -3
  4. data/README.markdown +90 -93
  5. data/countries.gemspec +3 -3
  6. data/lib/countries/cache/countries.json +1 -1
  7. data/lib/countries/cache/locales/ar.json +1 -1
  8. data/lib/countries/cache/locales/fa.json +1 -1
  9. data/lib/countries/cache/locales/he.json +1 -1
  10. data/lib/countries/country/class_methods.rb +4 -1
  11. data/lib/countries/country/emoji.rb +3 -0
  12. data/lib/countries/country.rb +6 -2
  13. data/lib/countries/data/countries/AD.yaml +1 -0
  14. data/lib/countries/data/countries/AE.yaml +1 -0
  15. data/lib/countries/data/countries/AF.yaml +1 -0
  16. data/lib/countries/data/countries/AG.yaml +1 -0
  17. data/lib/countries/data/countries/AI.yaml +1 -0
  18. data/lib/countries/data/countries/AL.yaml +1 -0
  19. data/lib/countries/data/countries/AM.yaml +1 -0
  20. data/lib/countries/data/countries/AO.yaml +1 -0
  21. data/lib/countries/data/countries/AQ.yaml +1 -0
  22. data/lib/countries/data/countries/AR.yaml +1 -0
  23. data/lib/countries/data/countries/AS.yaml +1 -0
  24. data/lib/countries/data/countries/AT.yaml +1 -0
  25. data/lib/countries/data/countries/AU.yaml +1 -0
  26. data/lib/countries/data/countries/AW.yaml +1 -0
  27. data/lib/countries/data/countries/AX.yaml +1 -0
  28. data/lib/countries/data/countries/AZ.yaml +1 -0
  29. data/lib/countries/data/countries/BA.yaml +1 -0
  30. data/lib/countries/data/countries/BB.yaml +1 -0
  31. data/lib/countries/data/countries/BD.yaml +1 -0
  32. data/lib/countries/data/countries/BE.yaml +1 -0
  33. data/lib/countries/data/countries/BF.yaml +1 -0
  34. data/lib/countries/data/countries/BG.yaml +1 -0
  35. data/lib/countries/data/countries/BH.yaml +1 -0
  36. data/lib/countries/data/countries/BI.yaml +1 -0
  37. data/lib/countries/data/countries/BJ.yaml +1 -0
  38. data/lib/countries/data/countries/BL.yaml +1 -0
  39. data/lib/countries/data/countries/BM.yaml +1 -0
  40. data/lib/countries/data/countries/BN.yaml +1 -0
  41. data/lib/countries/data/countries/BO.yaml +1 -0
  42. data/lib/countries/data/countries/BQ.yaml +1 -0
  43. data/lib/countries/data/countries/BR.yaml +3 -2
  44. data/lib/countries/data/countries/BS.yaml +1 -0
  45. data/lib/countries/data/countries/BT.yaml +1 -0
  46. data/lib/countries/data/countries/BV.yaml +1 -0
  47. data/lib/countries/data/countries/BW.yaml +1 -0
  48. data/lib/countries/data/countries/BY.yaml +1 -0
  49. data/lib/countries/data/countries/BZ.yaml +1 -0
  50. data/lib/countries/data/countries/CA.yaml +1 -0
  51. data/lib/countries/data/countries/CC.yaml +1 -0
  52. data/lib/countries/data/countries/CD.yaml +1 -0
  53. data/lib/countries/data/countries/CF.yaml +1 -0
  54. data/lib/countries/data/countries/CG.yaml +1 -0
  55. data/lib/countries/data/countries/CH.yaml +1 -0
  56. data/lib/countries/data/countries/CI.yaml +1 -0
  57. data/lib/countries/data/countries/CK.yaml +1 -0
  58. data/lib/countries/data/countries/CL.yaml +1 -0
  59. data/lib/countries/data/countries/CM.yaml +1 -0
  60. data/lib/countries/data/countries/CN.yaml +1 -0
  61. data/lib/countries/data/countries/CO.yaml +1 -0
  62. data/lib/countries/data/countries/CR.yaml +1 -0
  63. data/lib/countries/data/countries/CU.yaml +1 -0
  64. data/lib/countries/data/countries/CV.yaml +1 -0
  65. data/lib/countries/data/countries/CW.yaml +1 -0
  66. data/lib/countries/data/countries/CX.yaml +1 -0
  67. data/lib/countries/data/countries/CY.yaml +1 -0
  68. data/lib/countries/data/countries/CZ.yaml +1 -0
  69. data/lib/countries/data/countries/DE.yaml +1 -0
  70. data/lib/countries/data/countries/DJ.yaml +1 -0
  71. data/lib/countries/data/countries/DK.yaml +1 -0
  72. data/lib/countries/data/countries/DM.yaml +1 -0
  73. data/lib/countries/data/countries/DO.yaml +1 -0
  74. data/lib/countries/data/countries/DZ.yaml +1 -0
  75. data/lib/countries/data/countries/EC.yaml +1 -0
  76. data/lib/countries/data/countries/EE.yaml +1 -0
  77. data/lib/countries/data/countries/EG.yaml +1 -0
  78. data/lib/countries/data/countries/EH.yaml +1 -0
  79. data/lib/countries/data/countries/ER.yaml +1 -0
  80. data/lib/countries/data/countries/ES.yaml +1 -0
  81. data/lib/countries/data/countries/ET.yaml +1 -0
  82. data/lib/countries/data/countries/FI.yaml +1 -0
  83. data/lib/countries/data/countries/FJ.yaml +2 -1
  84. data/lib/countries/data/countries/FK.yaml +1 -0
  85. data/lib/countries/data/countries/FM.yaml +1 -0
  86. data/lib/countries/data/countries/FO.yaml +1 -0
  87. data/lib/countries/data/countries/FR.yaml +1 -0
  88. data/lib/countries/data/countries/GA.yaml +1 -0
  89. data/lib/countries/data/countries/GB.yaml +2 -0
  90. data/lib/countries/data/countries/GD.yaml +1 -0
  91. data/lib/countries/data/countries/GE.yaml +1 -0
  92. data/lib/countries/data/countries/GF.yaml +1 -0
  93. data/lib/countries/data/countries/GG.yaml +1 -0
  94. data/lib/countries/data/countries/GH.yaml +1 -0
  95. data/lib/countries/data/countries/GI.yaml +1 -0
  96. data/lib/countries/data/countries/GL.yaml +1 -0
  97. data/lib/countries/data/countries/GM.yaml +1 -0
  98. data/lib/countries/data/countries/GN.yaml +1 -0
  99. data/lib/countries/data/countries/GP.yaml +1 -0
  100. data/lib/countries/data/countries/GQ.yaml +1 -0
  101. data/lib/countries/data/countries/GR.yaml +1 -0
  102. data/lib/countries/data/countries/GS.yaml +1 -0
  103. data/lib/countries/data/countries/GT.yaml +1 -0
  104. data/lib/countries/data/countries/GU.yaml +1 -0
  105. data/lib/countries/data/countries/GW.yaml +1 -0
  106. data/lib/countries/data/countries/GY.yaml +1 -0
  107. data/lib/countries/data/countries/HK.yaml +2 -1
  108. data/lib/countries/data/countries/HM.yaml +1 -0
  109. data/lib/countries/data/countries/HN.yaml +1 -0
  110. data/lib/countries/data/countries/HR.yaml +1 -0
  111. data/lib/countries/data/countries/HT.yaml +1 -0
  112. data/lib/countries/data/countries/HU.yaml +1 -0
  113. data/lib/countries/data/countries/ID.yaml +1 -0
  114. data/lib/countries/data/countries/IE.yaml +1 -0
  115. data/lib/countries/data/countries/IL.yaml +1 -0
  116. data/lib/countries/data/countries/IM.yaml +1 -0
  117. data/lib/countries/data/countries/IN.yaml +1 -0
  118. data/lib/countries/data/countries/IO.yaml +1 -0
  119. data/lib/countries/data/countries/IQ.yaml +1 -0
  120. data/lib/countries/data/countries/IR.yaml +1 -0
  121. data/lib/countries/data/countries/IS.yaml +1 -0
  122. data/lib/countries/data/countries/IT.yaml +1 -0
  123. data/lib/countries/data/countries/JE.yaml +1 -0
  124. data/lib/countries/data/countries/JM.yaml +1 -0
  125. data/lib/countries/data/countries/JO.yaml +1 -0
  126. data/lib/countries/data/countries/JP.yaml +1 -0
  127. data/lib/countries/data/countries/KE.yaml +1 -0
  128. data/lib/countries/data/countries/KG.yaml +1 -0
  129. data/lib/countries/data/countries/KH.yaml +1 -0
  130. data/lib/countries/data/countries/KI.yaml +1 -0
  131. data/lib/countries/data/countries/KM.yaml +1 -0
  132. data/lib/countries/data/countries/KN.yaml +1 -0
  133. data/lib/countries/data/countries/KP.yaml +1 -0
  134. data/lib/countries/data/countries/KR.yaml +1 -0
  135. data/lib/countries/data/countries/KW.yaml +1 -0
  136. data/lib/countries/data/countries/KY.yaml +1 -0
  137. data/lib/countries/data/countries/KZ.yaml +1 -0
  138. data/lib/countries/data/countries/LA.yaml +1 -0
  139. data/lib/countries/data/countries/LB.yaml +1 -0
  140. data/lib/countries/data/countries/LC.yaml +1 -0
  141. data/lib/countries/data/countries/LI.yaml +1 -0
  142. data/lib/countries/data/countries/LK.yaml +1 -0
  143. data/lib/countries/data/countries/LR.yaml +1 -0
  144. data/lib/countries/data/countries/LS.yaml +1 -0
  145. data/lib/countries/data/countries/LT.yaml +1 -0
  146. data/lib/countries/data/countries/LU.yaml +1 -0
  147. data/lib/countries/data/countries/LV.yaml +1 -0
  148. data/lib/countries/data/countries/LY.yaml +1 -0
  149. data/lib/countries/data/countries/MA.yaml +1 -0
  150. data/lib/countries/data/countries/MC.yaml +1 -0
  151. data/lib/countries/data/countries/MD.yaml +1 -0
  152. data/lib/countries/data/countries/ME.yaml +1 -0
  153. data/lib/countries/data/countries/MF.yaml +1 -0
  154. data/lib/countries/data/countries/MG.yaml +1 -0
  155. data/lib/countries/data/countries/MH.yaml +1 -0
  156. data/lib/countries/data/countries/MK.yaml +1 -0
  157. data/lib/countries/data/countries/ML.yaml +1 -0
  158. data/lib/countries/data/countries/MM.yaml +1 -0
  159. data/lib/countries/data/countries/MN.yaml +1 -0
  160. data/lib/countries/data/countries/MO.yaml +1 -0
  161. data/lib/countries/data/countries/MP.yaml +1 -0
  162. data/lib/countries/data/countries/MQ.yaml +1 -0
  163. data/lib/countries/data/countries/MR.yaml +1 -0
  164. data/lib/countries/data/countries/MS.yaml +1 -0
  165. data/lib/countries/data/countries/MT.yaml +1 -0
  166. data/lib/countries/data/countries/MU.yaml +1 -0
  167. data/lib/countries/data/countries/MV.yaml +1 -0
  168. data/lib/countries/data/countries/MW.yaml +1 -0
  169. data/lib/countries/data/countries/MX.yaml +1 -0
  170. data/lib/countries/data/countries/MY.yaml +1 -0
  171. data/lib/countries/data/countries/MZ.yaml +1 -0
  172. data/lib/countries/data/countries/NA.yaml +1 -0
  173. data/lib/countries/data/countries/NC.yaml +1 -0
  174. data/lib/countries/data/countries/NE.yaml +1 -0
  175. data/lib/countries/data/countries/NF.yaml +1 -0
  176. data/lib/countries/data/countries/NG.yaml +1 -0
  177. data/lib/countries/data/countries/NI.yaml +1 -0
  178. data/lib/countries/data/countries/NL.yaml +1 -0
  179. data/lib/countries/data/countries/NO.yaml +1 -0
  180. data/lib/countries/data/countries/NP.yaml +11 -0
  181. data/lib/countries/data/countries/NR.yaml +1 -0
  182. data/lib/countries/data/countries/NU.yaml +1 -0
  183. data/lib/countries/data/countries/NZ.yaml +1 -0
  184. data/lib/countries/data/countries/OM.yaml +1 -0
  185. data/lib/countries/data/countries/PA.yaml +1 -0
  186. data/lib/countries/data/countries/PE.yaml +1 -0
  187. data/lib/countries/data/countries/PF.yaml +1 -0
  188. data/lib/countries/data/countries/PG.yaml +1 -0
  189. data/lib/countries/data/countries/PH.yaml +1 -0
  190. data/lib/countries/data/countries/PK.yaml +1 -0
  191. data/lib/countries/data/countries/PL.yaml +1 -0
  192. data/lib/countries/data/countries/PM.yaml +1 -0
  193. data/lib/countries/data/countries/PN.yaml +1 -0
  194. data/lib/countries/data/countries/PR.yaml +1 -0
  195. data/lib/countries/data/countries/PS.yaml +1 -0
  196. data/lib/countries/data/countries/PT.yaml +1 -0
  197. data/lib/countries/data/countries/PW.yaml +1 -0
  198. data/lib/countries/data/countries/PY.yaml +1 -0
  199. data/lib/countries/data/countries/QA.yaml +1 -0
  200. data/lib/countries/data/countries/RE.yaml +1 -0
  201. data/lib/countries/data/countries/RO.yaml +2 -1
  202. data/lib/countries/data/countries/RS.yaml +1 -0
  203. data/lib/countries/data/countries/RU.yaml +1 -0
  204. data/lib/countries/data/countries/RW.yaml +1 -0
  205. data/lib/countries/data/countries/SA.yaml +2 -0
  206. data/lib/countries/data/countries/SB.yaml +1 -0
  207. data/lib/countries/data/countries/SC.yaml +1 -0
  208. data/lib/countries/data/countries/SD.yaml +1 -0
  209. data/lib/countries/data/countries/SE.yaml +1 -0
  210. data/lib/countries/data/countries/SG.yaml +1 -0
  211. data/lib/countries/data/countries/SH.yaml +1 -0
  212. data/lib/countries/data/countries/SI.yaml +1 -0
  213. data/lib/countries/data/countries/SJ.yaml +1 -0
  214. data/lib/countries/data/countries/SK.yaml +1 -0
  215. data/lib/countries/data/countries/SL.yaml +1 -0
  216. data/lib/countries/data/countries/SM.yaml +1 -0
  217. data/lib/countries/data/countries/SN.yaml +1 -0
  218. data/lib/countries/data/countries/SO.yaml +1 -0
  219. data/lib/countries/data/countries/SR.yaml +1 -0
  220. data/lib/countries/data/countries/SS.yaml +2 -1
  221. data/lib/countries/data/countries/ST.yaml +1 -0
  222. data/lib/countries/data/countries/SV.yaml +1 -0
  223. data/lib/countries/data/countries/SX.yaml +1 -0
  224. data/lib/countries/data/countries/SY.yaml +1 -0
  225. data/lib/countries/data/countries/SZ.yaml +1 -0
  226. data/lib/countries/data/countries/TC.yaml +1 -0
  227. data/lib/countries/data/countries/TD.yaml +1 -0
  228. data/lib/countries/data/countries/TF.yaml +1 -0
  229. data/lib/countries/data/countries/TG.yaml +1 -0
  230. data/lib/countries/data/countries/TH.yaml +1 -0
  231. data/lib/countries/data/countries/TJ.yaml +1 -0
  232. data/lib/countries/data/countries/TK.yaml +1 -0
  233. data/lib/countries/data/countries/TL.yaml +1 -0
  234. data/lib/countries/data/countries/TM.yaml +1 -0
  235. data/lib/countries/data/countries/TN.yaml +1 -0
  236. data/lib/countries/data/countries/TO.yaml +1 -0
  237. data/lib/countries/data/countries/TR.yaml +1 -0
  238. data/lib/countries/data/countries/TT.yaml +1 -0
  239. data/lib/countries/data/countries/TV.yaml +1 -0
  240. data/lib/countries/data/countries/TW.yaml +1 -0
  241. data/lib/countries/data/countries/TZ.yaml +1 -0
  242. data/lib/countries/data/countries/UA.yaml +1 -0
  243. data/lib/countries/data/countries/UG.yaml +1 -0
  244. data/lib/countries/data/countries/UM.yaml +1 -0
  245. data/lib/countries/data/countries/US.yaml +1 -0
  246. data/lib/countries/data/countries/UY.yaml +1 -0
  247. data/lib/countries/data/countries/UZ.yaml +1 -0
  248. data/lib/countries/data/countries/VA.yaml +1 -0
  249. data/lib/countries/data/countries/VC.yaml +1 -0
  250. data/lib/countries/data/countries/VE.yaml +1 -0
  251. data/lib/countries/data/countries/VG.yaml +1 -0
  252. data/lib/countries/data/countries/VI.yaml +1 -0
  253. data/lib/countries/data/countries/VN.yaml +1 -0
  254. data/lib/countries/data/countries/VU.yaml +1 -0
  255. data/lib/countries/data/countries/WF.yaml +1 -0
  256. data/lib/countries/data/countries/WS.yaml +1 -0
  257. data/lib/countries/data/countries/YE.yaml +1 -0
  258. data/lib/countries/data/countries/YT.yaml +1 -0
  259. data/lib/countries/data/countries/ZA.yaml +1 -0
  260. data/lib/countries/data/countries/ZM.yaml +1 -0
  261. data/lib/countries/data/countries/ZW.yaml +1 -0
  262. data/lib/countries/data/subdivisions/FR.yaml +182 -0
  263. data/lib/countries/data/subdivisions/PH.yaml +0 -12
  264. data/lib/countries/data/subdivisions/TM.yaml +0 -14
  265. data/lib/countries/data/subdivisions/TR.yaml +78 -79
  266. data/lib/countries/data/translation_corrections.yaml +9 -5
  267. data/lib/countries/data.rb +12 -3
  268. data/lib/countries/structure.rb +1 -0
  269. data/lib/countries/subdivision.rb +1 -0
  270. data/lib/countries/version.rb +1 -1
  271. data/spec/country_spec.rb +21 -0
  272. data/spec/data_spec.rb +14 -2
  273. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 388c18f9459da546ae2a7e2d4e4d4015ec7f18c0
4
- data.tar.gz: 2d842c718ea758cda88eca16a1bbd2cb2be52786
3
+ metadata.gz: 735b197a9e7e8fda800a39ab7e2558da8ee59b80
4
+ data.tar.gz: 7af8cbb88f8301bf72f8831fffffa2d556f38a81
5
5
  SHA512:
6
- metadata.gz: 0d1a03e8b0310a8e841ed62fb3f6a80567f7fc505f5ca215b11b55dbb77b277c5629a3597088611be64c6d2c3581b25449013fd00e09ad0fdefc2d00bea753ea
7
- data.tar.gz: ac2d910650015bf2b8f7558c2e35d0f2af17ab84e9ac38ef37de2f4850c75b7c0a4618c8cc4e6748bad989be7b2209f74f943028e25b62a5d8aa43d8e064ac79
6
+ metadata.gz: 5d3b4230c7a1500f5eab70351d027b1ede91811817cac14e8e602a222d7fdc68b61bb8af5ef5b8150e5ae888e9e9ce01cc003dd85e6b27c33c8e822e9ddcf127
7
+ data.tar.gz: 8e9d46e88acad56b12dbead0157f0895a4c80b10bc850e3bf26fe15a10a950241d5ee54763719d39cf332a236eb16e62c99d5488bfad7a6e891997bad2af19b3
data/.travis.yml CHANGED
@@ -2,6 +2,7 @@ sudo: false
2
2
  cache: bundler
3
3
  language: ruby
4
4
  rvm:
5
+ - 1.9.3
5
6
  - 2.2.6
6
7
  - 2.3.3
7
8
  - 2.4.0
@@ -12,3 +13,4 @@ before_install:
12
13
  matrix:
13
14
  allow_failures:
14
15
  - rvm: ruby-head
16
+ - rvm: 1.9.3
data/CHANGELOG.md CHANGED
@@ -2,26 +2,52 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+
6
+ ## 2.0.8
7
+ - Add language data to Nepal @gkunwar
8
+ - Add start of week day @Vsanchezr
9
+ - Normalized Turkey's Subdivisions @emir
10
+
11
+ ## 2.0.7
12
+ - Content Fixes
13
+
14
+ ## 2.0.6
15
+ - Adds French Guiana nationality
16
+ - Add missing un_locode for south sudan
17
+ - Fix Norwegian country code (false -> NO)
18
+ - Add missing un location codes
19
+ - Further reduce calls to .keys to provide additional speedup and performance bump
20
+ - Add sixarm_ruby_unaccent to gemspec dependencies
21
+ - Update all official country names to the ISO 3166 standard
22
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.5...v2.0.6)
23
+
5
24
  ## 2.0.5
6
25
  - Fixes #408 Correct Subdivision files for AD, AE, AF, AG, and AL
26
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.4...v2.0.5)
7
27
 
8
28
  ## 2.0.4
9
29
  - Update cache.
30
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.3...v2.0.4)
10
31
 
11
32
  ## 2.0.3
12
33
  - Fix comparison with country to nil
13
34
  - Add NANP_prefix as separate field
35
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.2...v2.0.3)
14
36
 
15
37
  ## 2.0.2
16
38
  - Add nanp_prefix data.
39
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.1...v2.0.2)
17
40
 
18
41
  ## 2.0.1
19
- - Content updates
20
- - Fix bounding boxes that were mismatched.
21
- - Update bounding box update task to prevent any lookup from return anything other than a country.
42
+ - Content updates
43
+ - Fix bounding boxes that were mismatched.
44
+ - Update bounding box update task to prevent any lookup from return anything other than a country.
45
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v2.0.0...v2.0.1)
22
46
 
23
47
  ## 2.0.0
24
48
  - Remove find_country_by_translations
49
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.5...v2.0.0)
50
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.rc3...v2.0.0)
25
51
 
26
52
  ## 2.0.0.rc3
27
53
  - Content updates
@@ -29,22 +55,28 @@ This project adheres to [Semantic Versioning](http://semver.org/).
29
55
  - All bounding boxes updated
30
56
  - United States is now United States of America
31
57
  - Refactor of Rake tasks
58
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.rc2...v2.0.0.rc3)
32
59
 
33
60
  ## 2.0.0.rc2
34
61
  - Add fallback when looking up locales for pt-BR style languages
35
62
  - Implement project style guide
63
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.rc...v2.0.0.rc2)
36
64
 
37
65
  ## 2.0.0.rc
38
66
  - Fixed a regression that would purge the countries memory cache when adding a custom country #353
39
67
  - Various Content Updates
68
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.pre.4...v2.0.0.rc)
40
69
 
41
70
  ## 2.0.0.pre.4
71
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.pre.2...v2.0.0.pre.4)
42
72
  - Fix crash when app introduces an unexpected locale. Much thanks to @jstenhouse
43
73
 
44
74
  ## 2.0.0.pre.2
75
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v2.0.0.pre...v2.0.0.pre.2)
45
76
  - Bringing in content from 1.x branch
46
77
 
47
78
  ## 2.0.0.pre
79
+ - [Changelog from RC](https://github.com/hexorx/countries/compare/v1.2.5...v2.0.0.pre)
48
80
  - Selective loading translations of countries
49
81
  - Auto detect I18n locales to load
50
82
  - Add Configuration methods to force locales to load
@@ -62,6 +94,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
62
94
 
63
95
  ## 1.2.5 @ 2016-01-22
64
96
  - Rebuilding cache
97
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.4...v1.2.5)
65
98
 
66
99
  ## 1.2.4 @ 2016-01-21
67
100
  - Romanian Standard VAT rate is 20% as of 2016-01-01 #325 @dougal
@@ -69,19 +102,24 @@ This project adheres to [Semantic Versioning](http://semver.org/).
69
102
  - Added 47 as calling code for Bouvet Island, Norwegian territory #323
70
103
  - Added XAF as currency code for Congo @espen
71
104
  - Force converting passed locale to string @borodiychuk
105
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.3...v1.2.4)
72
106
 
73
107
  ## 1.2.3
74
108
  - Content Updates
109
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.2...v1.2.3)
75
110
 
76
111
  ## 1.2.2
77
112
  - Content Updates
113
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.1...v1.2.2)
78
114
 
79
115
  ## 1.2.1
80
116
  - Fixed issue in loading @rposborne
117
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.2.0...v1.2.1)
81
118
 
82
119
  ## 1.2.0 (yanked)
83
120
  - Cleaning up Global Load Path @rposborne
84
121
  - Add MOP as the currency for Macao @kriskhaira
122
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.1.0...v1.2.0)
85
123
 
86
124
  ## 1.1.0
87
125
  - Adding compare operation to country @guilleart
@@ -89,6 +127,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
89
127
  - Correct NL to NO for un_locode @ohenrik
90
128
  - Fix spelling of SjΓ¦lland @boatrite
91
129
  - Add alternate spelling of Macao/Macau @nityaoberoi
130
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v1.0.0...v1.1.0)
92
131
 
93
132
  ## 1.0.0
94
133
  - Switch to Marshalling for cache storage @rposborne
@@ -96,6 +135,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
96
135
  - Removed Rails 2.0 FormHelper COUNTRIES @rposborne
97
136
  - Add class codes method to get list of all alpha2 codes @rposborne
98
137
  - Change default behavior of all method to return a list of country objects vs a tuple of alpha code + name
138
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.5...v1.0.0)
99
139
 
100
140
  ## 0.11.5
101
141
  - Refactored data loading into it's own class
@@ -105,22 +145,27 @@ This project adheres to [Semantic Versioning](http://semver.org/).
105
145
  - Fix New York, Washington, Oklahoma state's latitude/longitude information @GUI
106
146
  - Bad state data present in Uruguay has been removed @saisha92
107
147
  - Various Other Content Updates by @danshultz @embs @sykaeh, @tg0
148
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.4...v0.11.5)
108
149
 
109
150
  ## 0.11.4
110
151
  - Added coordinates for subdivisions @fabn
111
152
  - Various Other Content Updates by @fabn, @snowblink
153
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.3...v0.11.4)
112
154
 
113
155
  ## 0.11.3
114
156
  - Translations update from i18n-data
157
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.2...v0.11.3)
115
158
 
116
159
  ## 0.11.2
117
160
  - silence ruby warnings @franckverrot
118
161
  - add find_country_by_translated_name @rposborne NOTE: this is garbage for the
119
162
  time being, some translations have duplicates in them and causes false results
163
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.1...v0.11.2)
120
164
 
121
165
  ## 0.11.1
122
166
  - added bounding box coordinates for VI, CW, PR, AS, and GU : @marinom
123
167
  - revert Lookup country by translated name via find_by_name @rposborne
168
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.11.0...v0.11.1)
124
169
 
125
170
  ## [0.11.0] - 2015-03-03
126
171
  ### Changed
@@ -130,3 +175,4 @@ This project adheres to [Semantic Versioning](http://semver.org/).
130
175
  - Content Updates @masolino, @rosetree, @stayhero, @skarlcf, @cllns, @speric, @rposborne
131
176
  - Adding Lat/Lng to countries @jabawack81
132
177
  - Readme Updates @cllns
178
+ - [Full Changelog](https://github.com/hexorx/countries/compare/v0.10.0...v0.11.0)
data/README.markdown CHANGED
@@ -1,29 +1,26 @@
1
- Countries
2
- =========
1
+ # Countries
3
2
 
4
- Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. It contains info for the following standards ISO3166-1(countries), ISO3166-2(states/subdivisions), ISO4217(currency) and E.164(phone numbers). I will add any country based data I can get access to. I hope this to be a repository for all country based information.
3
+ Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. It contains info for the following standards ISO3166-1 (countries), ISO3166-2 (states/subdivisions), ISO4217 (currency) and E.164 (phone numbers). I will add any country based data I can get access to. I hope this to be a repository for all country based information.
5
4
 
6
5
  [![Codewake](https://www.codewake.com/badges/ask_question_flat_square.svg)](https://www.codewake.com/p/countries) [![Gem Version](https://badge.fury.io/rb/countries.svg)](https://badge.fury.io/rb/countries) [![Build Status](https://travis-ci.org/hexorx/countries.svg)](https://travis-ci.org/hexorx/countries) [![Dependency Status](https://gemnasium.com/hexorx/countries.svg)](https://gemnasium.com/hexorx/countries) [![Code Climate](https://codeclimate.com/github/hexorx/countries.svg)](https://codeclimate.com/github/hexorx/countries)
7
6
 
8
- Installation
9
- ------------
7
+ ## Installation
10
8
 
11
9
  ``` bash
12
- gem install countries
10
+ gem install countries
13
11
  ```
14
12
 
15
- If you’re in Rails 2.3 or earlier, place this in your environment.rb:
13
+ Or you can install via Bundler if you are using Rails. Add this line to your application's Gemfile:
16
14
 
17
- ``` ruby
18
- config.gem 'countries'
15
+ ```ruby
16
+ gem 'countries'
19
17
  ```
20
18
 
21
- Or you can install via bundler Gemfile if you are using Rails 3/4/5:
19
+ And then execute:
22
20
 
23
- gem 'countries'
21
+ $ bundle
24
22
 
25
- Basic Usage
26
- -----------
23
+ ## Basic Usage
27
24
 
28
25
  Simply load a new country object using Country.new(*alpha2*) or the shortcut Country[*alpha2*]. An example works best.
29
26
 
@@ -31,15 +28,14 @@ Simply load a new country object using Country.new(*alpha2*) or the shortcut Cou
31
28
  c = ISO3166::Country.new('US')
32
29
  ```
33
30
 
34
- Configuration
35
- -----------
31
+ ## Configuration
36
32
 
37
33
  #### Country Helper
38
34
  Some apps might not want to constantly call `ISO3166::Country` this gem has a
39
35
  helper that can provide a `Country` class
40
36
 
41
37
  ``` ruby
42
- # with global Country Helper
38
+ # With global Country Helper
43
39
  c = Country['US']
44
40
  ```
45
41
 
@@ -61,8 +57,7 @@ has become
61
57
  gem 'countries', :require => 'countries/global'
62
58
  ```
63
59
 
64
- Selective Loading of Locales
65
- ------------
60
+ ## Selective Loading of Locales
66
61
 
67
62
  As of 2.0 you can selectively load locales to reduce memory usage in production.
68
63
 
@@ -83,8 +78,7 @@ ISO3166.configure do |config|
83
78
  end
84
79
  ```
85
80
 
86
- Attribute-Based Finder Methods
87
- ------------
81
+ ## Attribute-Based Finder Methods
88
82
 
89
83
  You can lookup a country or an array of countries using any of the data attributes via the find\_country\_by_*attribute* dynamic methods:
90
84
 
@@ -97,114 +91,118 @@ c = ISO3166::Country.find_country_by_alpha3('can')
97
91
  For a list of available attributes please see ISO3166::DEFAULT_COUNTRY_HASH.
98
92
  Note: searches are *case insensitive and ignore accents*.
99
93
 
100
- Country Info
101
- ------------
102
-
103
- Identification Codes
104
-
105
- c.number #=> "840"
106
- c.alpha2 #=> "US"
107
- c.alpha3 #=> "USA"
108
- c.gec #=> "US"
109
-
110
- Names & Translations
94
+ ## Country Info
111
95
 
112
- c.name #=> "United States"
113
- c.unofficial_names #=> ["United States of America", "Vereinigte Staaten von Amerika", "Γ‰tats-Unis", "Estados Unidos"]
96
+ ### Identification Codes
114
97
 
115
- # Get the names for a country translated to its local languages
116
- c = Country[:BE]
117
- c.local_names #=> ["BelgiΓ«", "Belgique", "Belgien"]
118
- c.local_name #=> "BelgiΓ«"
98
+ ```ruby
99
+ c.number # => "840"
100
+ c.alpha2 # => "US"
101
+ c.alpha3 # => "USA"
102
+ c.gec # => "US"
103
+ ```
119
104
 
120
- # Get a specific translation
121
- c.translation('de') #=> 'Vereinigte Staaten von Amerika'
122
- c.translations['fr'] #=> "Γ‰tats-Unis"
105
+ ### Names & Translations
123
106
 
124
- ISO3166::Country.translations # {"DE"=>"Germany",...}
125
- ISO3166::Country.translations('DE') # {"DE"=>"Deutschland",...}
126
- ISO3166::Country.all_translated # ['Germany', ...]
127
- ISO3166::Country.all_translated('DE') # ['Deutschland', ...]
107
+ ```ruby
108
+ c.name # => "United States"
109
+ c.unofficial_names # => ["United States of America", "Vereinigte Staaten von Amerika", "Γ‰tats-Unis", "Estados Unidos"]
110
+
111
+ # Get the names for a country translated to its local languages
112
+ c = Country[:BE]
113
+ c.local_names # => ["BelgiΓ«", "Belgique", "Belgien"]
114
+ c.local_name # => "BelgiΓ«"
115
+
116
+ # Get a specific translation
117
+ c.translation('de') # => 'Vereinigte Staaten von Amerika'
118
+ c.translations['fr'] # => "Γ‰tats-Unis"
119
+
120
+ ISO3166::Country.translations # {"DE"=>"Germany",...}
121
+ ISO3166::Country.translations('DE') # {"DE"=>"Deutschland",...}
122
+ ISO3166::Country.all_translated # ['Germany', ...]
123
+ ISO3166::Country.all_translated('DE') # ['Deutschland', ...]
124
+ ```
128
125
 
129
- Subdivisions & States
126
+ ### Subdivisions & States
130
127
 
131
128
  ``` ruby
132
- c.subdivisions #=> {"CO" => {"name" => "Colorado", "names" => "Colorado"}, ... }
133
- c.states #=> {"CO" => {"name" => "Colorado", "names" => "Colorado"}, ... }
129
+ c.subdivisions # => {"CO" => {"name" => "Colorado", "names" => "Colorado"}, ... }
130
+ c.states # => {"CO" => {"name" => "Colorado", "names" => "Colorado"}, ... }
134
131
  ```
135
- Location
132
+
133
+ ### Location
136
134
 
137
135
  ``` ruby
138
- c.latitude #=> "38 00 N"
139
- c.longitude #=> "97 00 W"
140
- c.latitude_dec #=> 39.44325637817383
141
- c.longitude_dec #=> -98.95733642578125
136
+ c.latitude # => "38 00 N"
137
+ c.longitude # => "97 00 W"
138
+ c.latitude_dec # => 39.44325637817383
139
+ c.longitude_dec # => -98.95733642578125
142
140
 
143
- c.region #=> "Americas"
144
- c.subregion #=> "Northern America"
141
+ c.region # => "Americas"
142
+ c.subregion # => "Northern America"
145
143
  ```
146
144
 
147
- Timezones **(optional)**
145
+ ### Timezones **(optional)**
148
146
 
149
- Add tzinfo to your gemfile, ensure it's required, Countries will not do this for you.
147
+ Add `tzinfo` to your Gemfile and ensure it's required, Countries will not do this for you.
150
148
 
151
- gem 'tzinfo', '~> 1.2', '>= 1.2.2'
149
+ ```ruby
150
+ gem 'tzinfo', '~> 1.2', '>= 1.2.2'
151
+ ```
152
152
 
153
153
  ``` ruby
154
- c.timezones.zone_identifiers #=> ["America/New_York", "America/Detroit", "America/Kentucky/Louisville", ...]
154
+ c.timezones.zone_identifiers # => ["America/New_York", "America/Detroit", "America/Kentucky/Louisville", ...]
155
155
  c.timezones.zone_info # see [tzinfo docs]( http://www.rubydoc.info/gems/tzinfo/TZInfo/CountryInfo)
156
156
  c.timezones # see [tzinfo docs]( http://www.rubydoc.info/gems/tzinfo/TZInfo/Country)
157
157
  ```
158
158
 
159
- Telephone Routing (E164)
159
+ ### Telephone Routing (E164)
160
160
 
161
161
  ``` ruby
162
- c.country_code #=> "1"
163
- c.national_destination_code_lengths #=> 3
164
- c.national_number_lengths #=> 10
165
- c.international_prefix #=> "011"
166
- c.national_prefix #=> "1"
162
+ c.country_code # => "1"
163
+ c.national_destination_code_lengths # => 3
164
+ c.national_number_lengths # => 10
165
+ c.international_prefix # => "011"
166
+ c.national_prefix # => "1"
167
167
  ```
168
168
 
169
- Boundary Boxes
169
+ ### Boundary Boxes
170
170
 
171
171
  ``` ruby
172
- c.min_longitude #=> '45'
173
- c.min_latitude #=> '22.166667'
174
- c.max_longitude #=> '58'
175
- c.max_latitude #=> '26.133333'
172
+ c.min_longitude # => '45'
173
+ c.min_latitude # => '22.166667'
174
+ c.max_longitude # => '58'
175
+ c.max_latitude # => '26.133333'
176
176
  ```
177
177
 
178
- European Union Membership
178
+ ### European Union Membership
179
179
 
180
180
  ``` ruby
181
- c.in_eu? #=> false
181
+ c.in_eu? # => false
182
182
  ```
183
183
 
184
- Currencies
185
- ----------
184
+ ## Currencies
186
185
 
187
186
  **WARNING** if you have a top level class named `Money` you will conflict with this gem. If this is a large issue we will add a feature to turn currency features off.
188
187
 
189
188
  Countries now uses the [Money](https://github.com/RubyMoney/money) gem. What this means is you now get back a Money::Currency object that gives you access to all the currency information.
190
189
 
191
190
  ``` ruby
192
- c.currency.code #=> 'USD'
193
- c.currency.name #=> 'Dollars'
194
- c.currency.symbol #=> '$'
191
+ c.currency.code # => 'USD'
192
+ c.currency.name # => 'Dollars'
193
+ c.currency.symbol # => '$'
195
194
  ```
196
195
 
197
- Address Formatting
198
- ------------------
196
+ ## Address Formatting
199
197
 
200
198
  A template for formatting addresses is available through the address_format method. These templates are compatible with the [Liquid][] template system.
201
199
 
202
200
  ``` ruby
203
- c.address_format #=> "{{recipient}}\n{{street}}\n{{city}} {{region}} {{postalcode}}\n{{country}}"
201
+ c.address_format # => "{{recipient}}\n{{street}}\n{{city}} {{region}} {{postalcode}}\n{{country}}"
204
202
  ```
205
203
 
206
- Loading Custom Data
207
- -------
204
+ ## Loading Custom Data
205
+
208
206
  As of 2.0 countries supports loading custom countries / overriding data in it's data set, though if you choose to do this please contribute back to the upstream repo!
209
207
 
210
208
  Any country registered this way will have it's data available for searching etc... If you are overriding an existing country, for cultural reasons, our code uses a simple merge, not a deep merge so you will need to __bring in all data you wish to be available__. Bringing in an existing country will also remove it from the internal management of translations, __all registered countries will remain in memory__.
@@ -222,14 +220,15 @@ ISO3166::Data.register(
222
220
  ISO3166::Country.new('LOL').name == 'Happy Country'
223
221
  ```
224
222
 
225
- Mongoid
226
- -------
223
+ ## Mongoid
227
224
 
228
225
  Mongoid support has been added. It is required automatically if Mongoid is defined in your project.
229
226
 
230
227
  Use native country fields in your model:
231
228
 
232
- field :country, type: Country
229
+ ```ruby
230
+ field :country, type: Country
231
+ ```
233
232
 
234
233
  Adds native support for searching/saving by a country object or alpha2 code.
235
234
 
@@ -262,21 +261,21 @@ Note that the database stores only the alpha2 code and rebuilds the object when
262
261
 
263
262
  ``` ruby
264
263
  def country
265
- super.name
264
+ super.name
266
265
  end
267
266
  ```
268
267
 
269
- Country Code in Emoji
270
- ----------
268
+ ## Country Code in Emoji
269
+
271
270
  ``` ruby
272
271
  c = Country['MY']
273
272
  c.emoji_flag # => "πŸ‡ΊπŸ‡Έ"
274
273
  ```
275
274
 
276
- Note on Patches/Pull Requests
277
- -----------------------------
275
+ ## Note on Patches/Pull Requests
276
+
277
+ ### Please do not submit pull requests on `cache/**/*`
278
278
 
279
- ## Please do not submit pull requests on cache/**/*
280
279
  Any additions should be directed upstream to [pkg-isocodes](http://anonscm.debian.org/cgit/pkg-isocodes/iso-codes.git/)
281
280
 
282
281
  New Bugs can be filed upstream here https://alioth.debian.org/projects/pkg-iso-codes/
@@ -302,12 +301,10 @@ the next ```rake update_cache```
302
301
  bump version in a commit by itself I can ignore when I pull)
303
302
  * Send me a pull request. Bonus points for topic branches.
304
303
 
305
- Copyright
306
- ---------
304
+ ## Copyright
307
305
 
308
306
  Copyright (c) 2016 hexorx. See LICENSE for details.
309
307
 
310
-
311
308
  [Teliax]: http://teliax.com
312
309
  [Centrex]: http://en.wikipedia.org/wiki/Centrex
313
310
  [CommonDataHub]: http://commondatahub.com
data/countries.gemspec CHANGED
@@ -13,11 +13,11 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = 'countries'
15
15
  gem.require_paths = ['lib']
16
- gem.version = Countries::VERSION
16
+ gem.version = Countries::VERSION.dup
17
17
  gem.license = 'MIT'
18
18
 
19
- gem.add_dependency('i18n_data', '~> 0.7.0')
20
- gem.add_dependency('money', '~> 6.7')
19
+ gem.add_dependency('i18n_data', '~> 0.8.0')
20
+ gem.add_dependency('money', '~> 6.9')
21
21
  gem.add_dependency('unicode_utils', '~> 1.4')
22
22
  gem.add_dependency('sixarm_ruby_unaccent', '~> 1.1')
23
23
  gem.add_development_dependency('rspec', '>= 3')